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 692259 - [PATCH] Opening "Network Settings" doesn't raise an existing system settings window
[PATCH] Opening "Network Settings" doesn't raise an existing system settings ...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
3.10
Depends on:
Blocks:
 
 
Reported: 2013-01-22 07:35 UTC by Kerrick Staley
Modified: 2013-06-05 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that fixes the issue (830 bytes, patch)
2013-04-04 05:26 UTC, Kerrick Staley
needs-work Details | Review

Description Kerrick Staley 2013-01-22 07:35:07 UTC
To reproduce:
1. Click "Network Settings" in the indicator menu
2. Bring another window to the front
3. Click "Network Settings" again

Expected result:
The existing system settings window comes to the front

Actual result:
The cursor changes to a "busy" indicator and nothing happens

Other notes:
- This also applies to the universal access, sound, and power indicators. The "System Settings" option in the system menu works as expected, however.
- The existing settings window does change panes to the selected one if it's different (so if you open the Sound pane, lower the window, and then click "Network Settings", the Network pane will be open once you re-raise the window)
Comment 1 Kerrick Staley 2013-04-04 03:21:10 UTC
Still exists in 3.8.
Comment 2 Kerrick Staley 2013-04-04 04:05:38 UTC
The panel applets just run the gnome-control-center binary asynchronously, so gnome-control-center's behavior needs to be changed (running the command when there is an existing window should raise that existing window).
Comment 3 Kerrick Staley 2013-04-04 05:26:41 UTC
Created attachment 240569 [details] [review]
patch that fixes the issue

I think this patch does what we want: whenever gnome-control-center is invoked from the command line, raise the existing window and focus it.
Comment 4 Owen Taylor 2013-04-04 15:53:51 UTC
Review of attachment 240569 [details] [review]:

Thanks for the patch! I don't think it's the right patch - we need to make sure that launch timestamps are passed correctly across the GApplication protocol and gtk_window_present_with_time() is called with the right time - not brute-force around focus stealing prevention with a call to gdk_window_raise(). This might require GTK+ changes - I'm not entirely sure how this is supposed to work.
Comment 5 Allison Karlitskaya (desrt) 2013-04-04 15:56:53 UTC
GApplication passes the startup notification environment variable across to the other side and injects it into GDK as the 'current timestamp'.  All you need to do is present the window using gtk_window_present().

Of course, this presupposes that the indicator is using startup-notification when spawning g-c-c...
Comment 6 Owen Taylor 2013-04-04 16:09:34 UTC
The code in GNOME Shell is launching the control center with startup notification:

    addSettingsAction: function(title, desktopFile) {
        let menuItem = this.addAction(title, function() {
                           let app = Shell.AppSystem.get_default().lookup_app(desktopFile);

                           if (!app) {
                               log('Settings panel for desktop file ' + desktopFile + ' could not be loaded!');
                               return;
                           }

                           Main.overview.hide();
                           app.activate();
                       });

(I think this bug is about gnome-shell despite the "Indicator" terminology.) So Ryan's claim is that if you do:

void
cc_window_show (CcWindow *center)
{
-  gtk_widget_show (GTK_WIDGET (center));
+  gtk_window_present (GTK_WINDOW (center));
}

in cc-window.c that should be a sufficient fix.
Comment 7 Kerrick Staley 2013-04-04 17:19:10 UTC
That change fixes the problem as well (and is simpler :).