Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup/new windows seems to tear, quickly disappear/reappear, and go off frame occasionally for fraction of second when clcking on moving it. #127

Open
MostHated opened this issue Jun 7, 2019 · 2 comments

Comments

@MostHated
Copy link

MostHated commented Jun 7, 2019

I must have gone about creating the window the wrong way? It keeps blinking/flashing a lot. I have tested in multiple terminals (ExtraTerm, Gnome Terminal, Tilix, and Yakuake)

Here is an example of the flashing:
https://i.imgur.com/sT3JOEx.gifv

https://i.imgur.com/b0OmaCI.gifv

Here is one I just took, the quality is lacking in exchange for much higher framerate. You can definitely see the crazyness.
https://i.imgur.com/YtnKnGQ.mp4

I don't believe I am doing anything incorrectly in code for the screen tearing/jitter, etc?

(P.S. Aside from these silly issues. I absolutely love the way things are starting to come out. It definitely takes some time and effort, but it really am starting to like the outcome)

func CreateTableDialog(btn *ui.Button, tableTitle string) {
	tableDialog := new(TableDialog)

	// --- Obtain terminal overall size ----------------------------------
	cw, ch := term.Size()

	// --- Save current values to temp value until saved -----------------
	tmpAssetData = AssetDetail

	// --- Create new popup window for table data ------------------------
	tableDialog.View = ui.AddWindow(cw/2-75, ch/2-16, ui.AutoSize, ui.AutoSize, TxtAssetCodes)
	ui.WindowManager().BeginUpdate()
	defer ui.WindowManager().EndUpdate()
	tableDialog.View.SetGaps(1, ui.KeepValue)
	tableDialog.View.SetModal(true)
	tableDialog.View.SetPack(ui.Vertical)

	tableDialog.Frame = NewFramedWindowInput(tableDialog.View, tableTitle, nil)

	// --- Create data table ---------------------------------------------
	td := ui.CreateTableView(tableDialog.Frame, 145, 15, 1)
	ui.ActivateControl(tableDialog.Frame, td)

NewFramedWindow is just a smaller helper with some defaults that I can over ride by passing something in. Mostly for practice and helping make things a bit cleaner.

func NewFramedWindowInput(parent *ui.Window, title string, params *FramedInputParams) *ui.Frame {

	if params != nil {
		SetValues(params)
	}

	frameWindowReturn := ui.CreateFrame(parent, defaultWidth, defaultHeight, defaultBorder, defaultScale)
	frameWindowReturn.SetPaddings(defaultPadX, defaultPadY)
	frameWindowReturn.SetPack(defaultOrientation)
	frameWindowReturn.SetTitle(title)
	return frameWindowReturn
}
@MostHated MostHated reopened this Jun 7, 2019
@MostHated MostHated changed the title Editable list dialog Popup/new windows seems to tear, quickly disappear/reappear, and go off frame occasionally for fraction of second when clcking on moving it. Jun 8, 2019
@VladimirMarkelov
Copy link
Owner

Interesting effect. I did not move windows much with a mouse and did not notice it before. But after trying to move a windows in maindemo with mouse around fast, I experienced the same issue. I am not sure how to fix it - I'll look into it later

@MostHated
Copy link
Author

No problem. It is appreciated. It usually happens the most if you move one, but there are times when it also happens when scrolling up/down/left/right in a table or text field. It seems to only happen when there is one window overlapping another, and it is the top window that does it in my experience so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants