pop-os / shell

Pop!_OS Shell
GNU General Public License v3.0
4.89k stars 268 forks source link

gtk apps cause issues focusing (stacked) windows #963

Open WuerfelDev opened 3 years ago

WuerfelDev commented 3 years ago

(1) Issue/Bug Description: I noticed that gtk apps are bigger than their window border. Therefore they catch the focus earlier. That is - especially with gaps not a big problem, but in stacked mode it is. The gtk window is raised to the top of the stack when the mouse is on the window border.

(2) Steps to reproduce (if you know):

  1. Set focus-mode to 'sloppy' or 'mouse' in /org/gnome/desktop/wm/preferences
  2. Stack gtk and non-gtk windows
  3. non-gtk window active then
  4. move mouse slowly over the top border (and happens also on all other borders - but not always).
  5. -> The gtk window gets raised

(3) Expected behavior: The current, non-gtk window should stay on top of the stack

(4) Distribution (run cat /etc/os-release):

NAME="Ubuntu"
VERSION="21.04 (Hirsute Hippo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 21.04"
VERSION_ID="21.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=hirsute
UBUNTU_CODENAME=hirsute

also tested in VM with pop-os 21.04

(5) Gnome Shell version: GNOME Shell 3.38.4

(6) Pop Shell version (run apt policy pop-shell or provide the latest commit if building locally):

a3fa53e9f00be256f8652d6d89ffabe2d95e792d

(7) Where was Pop Shell installed from: From source using make debug

(8) Monitor Setup (2 x 1080p, 4K, Primary(Horizontal), Secondary(Vertical), etc): 1x 2560x1440

(9) Other Installed/Enabled Extensions:

❯gnome-extensions list --enabled
hide-dash-forked@farnasirim.com
click-to-close-overview@l3nn4rt.github.io
transparent-shell@siroj42.github.io
clipboard-indicator@tudmotu.com
appmenu-color-icon@yanbab.gitlab.com
SimplerOffMenu.kerkus@pm.me
caffeine@patapon.info
workspace_scroll@squgeim.com.np
blur-my-shell@aunetx
improved-workspace-indicator@michaelaquilina.github.io
pop-shell@system76.com
workspace-switch-wraparound@theychx.org
multi-monitors-add-on@spin83
system76-power@system76.com
pop-cosmic@system76.com
native-window-placement@gnome-shell-extensions.gcampax.github.com

(issue exists in fresh pop-os 21.04 too):

ding@rastersoft.com
multi-monitors-add-on@spin83
pop-cosmic@system76.com
pop-shell@system76.com
system76-power@system76.com
ubuntu-appindicators@ubuntu.com
ubuntu-dock@ubuntu.com

(10) Other Notes:

size of windows (looking glass):

Screenshot from 2021-05-07 11-07-52 Screenshot from 2021-05-07 11-08-25 Screenshot from 2021-05-07 11-08-52

Stacked: Screenshot from 2021-05-07 11-14-26 Screenshot from 2021-05-07 11-14-50

WuerfelDev commented 3 years ago

This is somehow related to a xprop _GTK_FRAME_EXTENTS. Maybe it is possible to disable the behavior when tiling mode is on?

WuerfelDev commented 3 years ago

In a GTK Inspector window I can set this CSS:

decoration {
    marign:0px;
}

The problem is gone. (Also the ability to use the border to resize the window by dragging the border) Adding the CSS to a user theme did however not work.

The solutions I think of are

  1. Finding a way to apply this CSS to all windows that are in the back of the stack
  2. Making sure all other windows in a stack are completely hidden and don't have anything (actors,etc) accessible.
WuerfelDev commented 3 years ago

In my quick testing the problem is not present on Wayland. It seems that calling actor.hide() does not remove the ability to be focused by mouse in X11... Maybe the root of the bug is somewhere here: https://gitlab.gnome.org/GNOME/mutter/-/blob/master/src/core/window.c#L2632