GNOME Bugzilla – Bug 692259
[PATCH] Opening "Network Settings" doesn't raise an existing system settings window
Last modified: 2013-06-05 14:31:05 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)
Still exists in 3.8.
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).
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.
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.
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...
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.
That change fixes the problem as well (and is simpler :).