marcinjahn / gnome-peek-top-bar-on-fullscreen-extension

Gnome Extension that triggers top panel to show up on full screen apps when cursor hovers the top edge of the screen
MIT License
22 stars 0 forks source link

White pixel in center of the screen on Gnome 44.3 with Wayland #10

Open DanHerbert opened 1 year ago

DanHerbert commented 1 year ago

It seems that the latest update that fixed #9 with 60334b0 has caused a white dot to appear in the center of my primary workspace on Gnome 44.3 with Wayland. This white dot hides when in Activities view and reappears when I exit that view. It also seems fixed to my primary workspace. If I swipe between workspaces with my laptop's touch pad, the dot animates along with the rest of the workspace. But otherwise it stays fixed in the center of the screen, regardless of what apps are opened.

Disabling this extension makes the dot go away, and re-enabling it makes the dot appear again, so I'm fairly confident that it's something related to this extension, though I'm not sure what 60334b0 might have done to cause that since it's presumably not happening for everyone. My only guess is that it could be a combination of Gnome settings and this extension. I tried disabling all other extensions and the problem remains with only the top bar extension enabled on a fresh login with no other apps open.

marcinjahn commented 1 year ago

Do you use any custom theme?

DanHerbert commented 1 year ago

No custom themes. I'm using just the Gnome default light theme.

DanHerbert commented 1 year ago

So I figured out what setting causes it: In Gnome Tweaks I have the Windows > Center New Windows toggle enabled. Disabling that setting makes the dot caused by the extension to disappear.

I'm not sure if that's a problem that's fixable within the extension or if it's better to just treat this as working-as-intended.

marcinjahn commented 1 year ago

Interesting, myself, even with the "Center New Windows" tweak enabled, do not experience that issue.

I actually thought about spawning the dummy window (that's what this extension does on Wayland) outside of the screen viewport. Maybe you could try that yourself and see if it changes anything.

You'd do that by modifying the file at ~/.local/share/gnome-shell/extensions/peek-top-bar-on-fullscreen@marcinjahn.com/dummy-window.js.

Modify the createWindow function to look something like this:

  createWindow(app) {
    let win = app.win;
    if (!win) {
      win = new Gtk.ApplicationWindow({
        application: app,
        defaultHeight: 0,
        defaultWidth: 0,
      });
    }
    win.set_keep_above(true);
    win.set_decorated(false);
    win.set_skip_taskbar_hint(true);
    win.set_skip_pager_hint(true);
    win.set_accept_focus(false);
    win.present();

    win.move(0, 0);
  }

The win.move(0, 0); is what I've added. After modifying the file, just disable and enable the extension, the changes will be registered right away. Try with different values than (0, 0). These are (x, y) coordinates. I honestly do not know if that will have any effect, but I guess it's worth a try.

DanHerbert commented 1 year ago

Adding that win.move(0, 0) call fixed it! I tested with the Center New Windows setting enabled and toggling the extension to restart it with that patch and it definitely fixes the problem.

I've also managed to reproduce this on a clean Arch/Gnome 44.3/Wayland VM with everything default except the Center New Windows setting and this extension.

marcinjahn commented 1 year ago

That's great to hear. @DanHerbert , I could push this fix unless you want to open a PR for it?

DanHerbert commented 1 year ago

Feel free to push the change whenever works for you.

marcinjahn commented 1 year ago

I looked at it today, and the "fix" I proposed actually has a "small" issue - the top bar no longer shows up on full screen! So, the extension becomes useless basically 😓 And, I am still unable to replicate it. If someone else experiences it, feel free to experiment, contributions are more than welcome. In the meantime, I'll add a proper "how to contribute" guide to the readme.

Nokse22 commented 7 months ago

For me it's on the top left corner only in the first workspace. Using Gnome 45.3, Wayland, Fedora 39.

Screencast from 2024-02-03 22-15-49.webm

eriolloan commented 5 months ago

I'm experiencing exactly the same as Noske22. (BTW, it's probably on the top-left because "center windows" is turned off.)

Editing dummy-window.js changed the white pixel's position to be on the first row of the first line:

Capture d’écran du 2024-04-03 13-45-43

win.move(0, 0) or win.move(-1, -1) made no difference (I don't know much about the innards of GNOME workspaces and I guess this outcome is probably expected).