Merge lp:~gala-dev/gala/always-focus-on-map into lp:gala

Proposed by Tom Beckmann
Status: Rejected
Rejected by: Danielle Foré
Proposed branch: lp:~gala-dev/gala/always-focus-on-map
Merge into: lp:gala
Diff against target: 42 lines (+10/-0)
3 files modified
data/org.pantheon.desktop.gala.gschema.xml (+5/-0)
src/Plugin.vala (+4/-0)
src/Settings.vala (+1/-0)
To merge this branch: bzr merge lp:~gala-dev/gala/always-focus-on-map
Reviewer Review Type Date Requested Status
Gala developers Pending
Review via email: mp+202686@code.launchpad.net

Commit message

plugin: add gsettings key toggling whether windows should always be focused when they're mapped

Description of the change

This adds a key always-focus-on-map to gala's behavior gsettings. Once enabled, this will make gala call activate() on each window that is mapped, so windows will always be focused once mapped. Normally, mutter does quite some work to determine whether a newly mapped window should be focused or not, most importantly in our case, if a newer interaction with a different window has occurred since that window was "started". And this very part is currently broken in Gtk, the startup time is not correctly set for multi window apps, like the terminal, and the last interaction with any window of the app is used for the new window for comparision instead. See here: https://bugzilla.gnome.org/show_bug.cgi?id=721145

As the fix proposed in the GNOME bug is part of a larger patch restructuring the GtkApplication code, I don't think we'll be able to backport it. Instead I would propose this temporary fix for luna so we can get rid of this annoying problem, hopefully for isis, we have a Gtk with that patch applied.

An important question to be talked about would also be whether we want to have this enabled by default. Enabling works with a simple "gsettings set org.pantheon.desktop.gala.behavior always-focus-on-map true".
I've set it to false by default currently, but I doubt the current behavior can be considered better than this.

Relevant gala bug: https://bugs.launchpad.net/gala/+bug/1220179

To post a comment you must log in.
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

As said on IRC. I would prefer to find out what fixed this problem in Gtk+ 3.11.x rather than introducing this additional hacky option ;)

Unmerged revisions

367. By Tom Beckmann

plugin: add gsettings key toggling whether windows should always be focused when they're mapped

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/org.pantheon.desktop.gala.gschema.xml'
2--- data/org.pantheon.desktop.gala.gschema.xml 2013-09-28 22:35:41 +0000
3+++ data/org.pantheon.desktop.gala.gschema.xml 2014-01-22 15:13:05 +0000
4@@ -51,6 +51,11 @@
5 followed by a ':' and then the command. ';;' is used as delimiter between command defintions.
6 </description>
7 </key>
8+ <key type="b" name="always-focus-on-map">
9+ <default>false</default>
10+ <summary>Always raise and focus windows when they map</summary>
11+ <description>When enabled windows are always raised and focused when mapped, even if they would disrupt a newer user interaction with a different window</description>
12+ </key>
13 <key type="b" name="edge-tiling">
14 <default>true</default>
15 <summary>Enable edge tiling when dropping windows on screen edges</summary>
16
17=== modified file 'src/Plugin.vala'
18--- src/Plugin.vala 2013-11-22 20:56:09 +0000
19+++ src/Plugin.vala 2014-01-22 15:13:05 +0000
20@@ -625,6 +625,10 @@
21 map_completed (actor);
22 return;
23 }
24+
25+ if (BehaviorSettings.get_default ().always_focus_on_map) {
26+ window.activate(window.get_display ().get_current_time ());
27+ }
28
29 mapping.add (actor);
30
31
32=== modified file 'src/Settings.vala'
33--- src/Settings.vala 2013-07-11 21:51:43 +0000
34+++ src/Settings.vala 2014-01-22 15:13:05 +0000
35@@ -21,6 +21,7 @@
36 {
37 public bool dynamic_workspaces { get; set; }
38 public bool edge_tiling { get; set; }
39+ public bool always_focus_on_map { get; set; }
40 public string panel_main_menu_action { get; set; }
41 public string toggle_recording_action { get; set; }
42 public string overlay_action { get; set; }

Subscribers

People subscribed via source and target branches