After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691854 - Should pass our main window XID to IBus setup tools
Should pass our main window XID to IBus setup tools
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Region & Language
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-16 14:06 UTC by Rui Matos
Modified: 2013-01-21 14:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell: Export our main window XID in an environment variable (2.01 KB, patch)
2013-01-20 18:20 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2013-01-16 14:06:00 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.
Comment 1 Matthias Clasen 2013-01-16 14:13:27 UTC
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
Comment 2 Matthias Clasen 2013-01-17 13:46:14 UTC
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.
Comment 3 Rui Matos 2013-01-20 18:20:30 UTC
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.
Comment 4 Matthias Clasen 2013-01-20 20:00:23 UTC
(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 ?
Comment 5 Bastien Nocera 2013-01-21 06:42:39 UTC
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.
Comment 6 Rui Matos 2013-01-21 14:22:17 UTC
(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.
Comment 7 Rui Matos 2013-01-21 14:57:02 UTC
(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