feenkcom / gtoolkit

Glamorous Toolkit is the Moldable Development environment. It empowers you to make systems explainable through experiences tailored for each problem.
https://gtoolkit.com
MIT License
1.12k stars 49 forks source link

Redraw failure and screen flicker under Linux #2511

Closed khinsen closed 1 year ago

khinsen commented 2 years ago

In v0.8.1407, there are two possibly related display issues:

  1. When I switch from another virtual desktop back to the one containing my GT window, the GT window is not redrawn immediately. I have to launch some action from the keyboard (e.g. Shift-Return to open Spotter) to get the window redrawn.
  2. After using GT for some time, the screen starts to flicker, and most mouse clicks are not acted on.

It's number 2 that makes GT almost unusable. I suspect that what causes this flicker state is either closing a second GT window (usually the debugger) or switching the main window to full-screen mode. The two are the same for me because I use the i3 window manager, with nothing but GT in a virtual desktop.

I had noticed this problem before, for a few versions around 1387, but then it stopped. Now it's back.

Observed under a fully updated Ubuntu 20.04.

khinsen commented 2 years ago

Another symptom: I cannot take screenshots anymore, because GT doesn't redraw the screen behind the screenshot utility.

khinsen commented 2 years ago

After some more experiments, I conclude:

  1. The screen flicker happens only when a GT window is in full-screen mode. Keeping it slightly smaller is thus a good workaround.
  2. Screen flicker starts the first time I enlarge a window to the full screen. I can then save the image, restart, and work normally again until the next time I switch the window from less-than-full-screen to full-screen.
  3. The redraw issue is independent of window size.
akgrant43 commented 2 years ago

Hi Konrad, I'm not able to reproduce any of this on an Ubuntu 20.04 install. Are you able to produce a small video demonstrating it?

khinsen commented 2 years ago

I haven't done any screen recordings under Linux yet, so I have to search for suitable software first. Might take a while.

akgrant43 commented 2 years ago

If you just want the video, I use peek:

https://www.fossmint.com/peek-gif-screen-recorder-for-linux/

It advertises itself as a gif recorder, but you can also save to mp4 / mkv, which is much faster and what I normally use (mp4 if it has to be Windows compatible, mkv otherwise).

If you want to also record audio, I use OBS:

https://obsproject.com/

khinsen commented 2 years ago

Thanks for the suggestions! I went for OBS since I will need video+audio in the near future.

As a first demo, the redrawing issue: https://filesender.renater.fr/?s=download&token=b8525f44-d4b6-4e4f-89c9-1a458c73a7b4

I'll watch out for the screen flicker issue, which I haven't seen since I updated to v0.8.1428.

In the demo above, all applications run in full-screen mode, which is my normal way of working on a laptop screen. I use Ubuntu 20.04 with the i3 window manager (via Regolith). Maybe the window manager matters for this issue, but in the not-so-distant past, redrawing worked as expected, so something has changed in GT.

khinsen commented 2 years ago

I did get a screen flicker event with v0.8.1428. Here is the recording: https://filesender.renater.fr/?s=download&token=f98d9ab5-a145-4bf5-936e-f363afe3c6b9

khinsen commented 2 years ago

One more detail: the redraw failure remains even when GT is not in full-screen mode.

TeMPOraL commented 2 years ago

Might be related to how tiling WMs work. In my case: GT v0.8.1501 on Ubuntu 18.04.6 LTS, with StumpWM as a tiling window manager, I do get the redraw issues as you described, but I don't get flickering. Mouse events get dropped occasionally - increasingly often over time, but even after couple hours, GT is still usable (at least if I don't mouse around too fast).

offray commented 2 years ago

I have experience this redraw failures and in general UI slowness since my first tries on early versions of GT as reported here: https://github.com/feenkcom/gtoolkit/issues/1898 (including screenshots of redraw failures in tiling VM under Manjaro Gnu/Linux). Some minor improvements have been done, but the redraw issues remains until today.

momerath42 commented 2 years ago

As over-eagerly reported on discord: Failure to redraw under Version 0.8.2086, with i3 (tiling) window-manager.

More specifically, if I have a set of windows in tabbed configuration, and switch between them, the GT tab gets highlighted, but the contents of the previously-focused window remain.

I can make my own recording if that would be helpful, and I'm willing to dust off my bpftrace-fu or do any other debugging that would be helpful, if someone who knows what to look for in this case can guide me.

girba commented 2 years ago

I believe this issue is not relevant anymore. Please open another one if you still find something similar to happen.

girba commented 2 years ago

@momerath42 thank you for opening a separate issue.

offray commented 2 years ago

I'm still experiencing problems with redrawing on tiling window manager (AwesomeWM) since the first iterations of GToolkit. @girba why this is not an issue anymore when is so visible for Linux users?

@momerath42 Glad to see you also here and welcomed!

girba commented 2 years ago

Because I thought it was fixed as many things have changed since May.

offray commented 2 years ago

@girba thanks for reopening again.

On the UX level, I would say that this is the more visible bug for users of GT on a daily basis. I have devised workarounds that I share with other tiling WM user in the local community, like having another window in the same workspace where GT is located, to force the redraw of the GT window as this doesn't happen properly just by focusing on that workspace or clicking on it (like with other apps in the tiling VM).

girba commented 2 years ago

It should be noted that there are other users of Linux machines that do not have this issue.

khinsen commented 2 years ago

My somewhat vague memory is that the flicker problem happens only when the GT window is in full-screen mode. That happens much more frequently with tiling windows managers, which both @offray and myself are using (mine is i3). The redraw failure seems independent of that, but is a bit random. There are (rare!) days when I don't have a redraw issue at all. More frequently, it happens every single time I switch to the workspace containing the GT window.

offray commented 2 years ago

My experience is the same as @khinsen. I experience the redrawing issue daily (on AwesomeWM) as tiling WM use the complete workspace for the window, unless another windows is raised in the same workspace. That's why the workaround is to put other non GT window app in the same space and raise it to get the proper redrawing of GT windows there.

It seems that GT + tiling window managers is a common combination in Linux early adopters across several distros and WMs.

syrel commented 2 years ago

Could someone provide me with a link from which I can download the same Linux distro with a tiling WM? I have no idea how to reproduce it...

khinsen commented 2 years ago

I am using Ubuntu 20.04 (pre-installed on my Dell laptop) with Regolith 1.6 as an i3-based GNOME add-on.

offray commented 2 years ago

@syrel if you're looking for an Arch based minimal Linux distro with tiling WM, you could try Arch Craft from https://archcraft.io/

girba commented 1 year ago

GT now relies on a new architecture in place for Linux. We are closing this as it's not reproducible. If it is still observable, please open another issue.