mate-desktop / marco

MATE default window manager
https://mate-desktop.org
GNU General Public License v2.0
196 stars 87 forks source link

GtkDialog windows are raised when any window is raised #340

Open epgfm opened 7 years ago

epgfm commented 7 years ago

Expected behaviour

Only the terminal window should be raised when releasing ALT+TAB on a terminal after a CTRL+ALT+D

Actual behaviour

The terminal window is raised, but any m-c-c window is raised too (such as the sound setting window)

Steps to reproduce the behaviour

Open Firefox, a Terminal and the Sound settings, then hit CTRL+ALT+D to show desktop. Use CTRL+ALT to switch through windows until you select terminal, and release.

MATE general version

1.18

Package version

On Ubuntu MATE 17.04 :

marco: Installed: 1.18.0-0ubuntu1 mate-control-center: Installed: 1.18.1-0ubuntu1

On Ubuntu MATE 17.10 Alpha 2

marco: Installed: 1.18.1-1 mate-control-center: Installed: 1.18.2-1

Linux Distribution

Ubuntu MATE

Link to downstream report of your Distribution

https://bugs.launchpad.net/ubuntu/+source/marco/+bug/1708766

Additional information

Not sure if this issue is in Marco or in mate-control-center, but the issue does not happen when using Compiz instead of Marco as a WM.

Possibly related: Issue #299

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/47951629-mate-control-center-windows-are-raised-when-any-window-is-raised?utm_campaign=plugin&utm_content=tracker%2F841233&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F841233&utm_medium=issues&utm_source=github).
raveit65 commented 7 years ago

Confirmed, this happens if a window is a GtkDialog window. You can see that if executing the application in a terminal.

[rave@mother ~]$ mate-volume-control
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

Marco thinks that the dialog window belongs to the application which you want to restore via crtl+alt. You can confirm that with mate-search-tool (normal window hint) and mate-screenshot (dialog window hint). With mate-search-tool this doesn't happen. Or you can fire up gtk3-inspector on mate-volume-control and set the the window-hint-type to GDK_WINDOW_TYPE_HINT_NORMAL. Than mate-volume-control window act like it should if using crtl+tab. We have 2 solutions:

  1. porting every GtkDialogWindow to a normal window and make gtk+ happy, the ugly terminal warning will be gone......... huge job
  2. Maybe it's possible to change the crtl+tab code in maco to ignore GDK_WINDOW_TYPE_HINT_DIALOG and assume it is a normal window. But this is more a hack or workaround.
monsta commented 7 years ago

Maybe try Metacity as well, and if it doesn't happen with it, try to find the commit that fixed it...

monsta commented 7 years ago

Reproduced in GTK+2 build of 1.16 as well (in Mint 18.1).

flexiondotorg commented 4 years ago

I can't reproduce this with MATE Desktop 1.24 on Ubuntu 20.04.

monsta commented 4 years ago

Maybe it's a misleading wording, but it's not about the main m-c-c window, but about various settings windows (dialogs) from it. Still reproducible with keyboard or sound settings. Hope the new issue title will help a bit...

rcaridade145 commented 4 years ago

I have a branch dealing with focus issues (haven't had the time to test it thoroughly https://github.com/rcaridade145/marco/tree/fix-focus so not PR yet) - currently just this backports this commit https://gitlab.gnome.org/GNOME/metacity/-/commit/bf17c79171512d6a27c31e003e60a25e7a093226 based on a Mutter commit

window: Do not unfocus on new window

mutter would remove focus from a toplevel when showing one of its transient window which is not on top and not focused.

When using xdg_popup without grab as allowed in xdg_shell v6, the popup wouldn't be focused, and if an intermediate event occurs before the popup is shown, it's not placed on top either, which could randomly trigger a loss of focus in the corresponding toplevel window.

Remove that special case, it doesn't make much sense to globally unset focus when mapping a new window.