Bug 1553835 - Set GTK window hint to make PIP window floating r=stransky

I believe the GDK_WINDOW_TYPE_HINT_UTILITY [1] makes the most sense,
especially when looking at the description of the related
_NET_WM_WINDOW_TYPE_UTILITY [2].

This works well in i3-wm.

[1] https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkWindowTypeHint
[2] https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317606816

Differential Revision: https://phabricator.services.mozilla.com/D48771

--HG--
extra : moz-landing-system : lando
This commit is contained in:
dennisschagt 2019-10-10 10:00:32 +00:00
parent 1a09ebdd96
commit 67d3f0e9f3

View File

@ -3850,6 +3850,11 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
mGtkWindowRoleName = "Toplevel";
SetDefaultIcon();
if (mIsPIPWindow) {
gtk_window_set_type_hint(GTK_WINDOW(mShell),
GDK_WINDOW_TYPE_HINT_UTILITY);
}
// each toplevel window gets its own window group
GtkWindowGroup* group = gtk_window_group_new();
gtk_window_group_add_window(group, GTK_WINDOW(mShell));