GNOME Bugzilla – Bug 691854
Should pass our main window XID to IBus setup tools
Last modified: 2013-01-21 14:57:05 UTC
Should pass our main window XID to IBus setup tools so that they can set the WM_TRANSIENT_FOR hint and look like modal dialogs.
This might also be useful in a few other places, like the color and network panels. Although the color stuff may already pass an xid via dbus, and we're getting rid of the nm-c-e callouts in the network panel this cycle, hopefully
Once we have this in place, please add a paragraph to https://live.gnome.org/AllanDay/IMEGuidelines explaining how to use this, with a code snipplet, so ime authors get it right.
Created attachment 233956 [details] [review] shell: Export our main window XID in an environment variable This allows external tools to know that they are being called from gnome-control-center and look like attached modal dialogs as per design. -- Here's an implementation for the ibus anthy setup tool: https://github.com/rtcm/ibus-anthy/commit/56a646fa40e5abd1216d83337c6374f4eab16776 I'll update the guidelines in the wiki if we agree to do it like this.
(In reply to comment #3) > I'll update the guidelines in the wiki if we agree to do it like this. Looks fine to me. Just one question: do you need to set the window type to dialog, or do things work as expected without it ?
Review of attachment 233956 [details] [review]: Looks fine otherwise. ::: shell/gnome-control-center.c @@ +1333,3 @@ + if (!window) + { + g_unsetenv ("GNOME_CONTROL_CENTER_XID"); I doubt this is very useful.
(In reply to comment #4) > (In reply to comment #3) > > > I'll update the guidelines in the wiki if we agree to do it like this. > > Looks fine to me. Just one question: do you need to set the window type to > dialog, or do things work as expected without it ? In anthy's case the window is already a GtkDialog so it works without. But, you're right, I'll throw in a toplevel.set_type_hint(Gdk.WindowTypeHint.DIALOG) to make it clear.
(In reply to comment #5) > + g_unsetenv ("GNOME_CONTROL_CENTER_XID"); > > I doubt this is very useful. Ok, I've removed the g_unsetenv() call. Attachment 233956 [details] pushed as ac359b1 - shell: Export our main window XID in an environment variable