guibuilder_pel7x64builder0
6 years ago
11 changed files with 4755 additions and 248 deletions
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
From ee5b766580c702858bb10bab764a39f95a5b6432 Mon Sep 17 00:00:00 2001 |
||||
From: Carlos Garnacho <carlosg@gnome.org> |
||||
Date: Wed, 13 Jun 2018 13:48:24 +0200 |
||||
Subject: [PATCH] clutter: Only reset scroll axes on slave devices |
||||
|
||||
As a plus, unknown source device IDs will just warn instead of crash. |
||||
--- |
||||
clutter/clutter/x11/clutter-device-manager-xi2.c | 3 ++- |
||||
1 file changed, 2 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/clutter/clutter/x11/clutter-device-manager-xi2.c b/clutter/clutter/x11/clutter-device-manager-xi2.c |
||||
index 62f558380..ec7268ca8 100644 |
||||
--- a/clutter/clutter/x11/clutter-device-manager-xi2.c |
||||
+++ b/clutter/clutter/x11/clutter-device-manager-xi2.c |
||||
@@ -1803,7 +1803,8 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator, |
||||
_clutter_input_device_set_stage (device, NULL); |
||||
} |
||||
|
||||
- _clutter_input_device_reset_scroll_info (source_device); |
||||
+ if (clutter_input_device_get_device_mode (source_device) == CLUTTER_INPUT_MODE_SLAVE) |
||||
+ _clutter_input_device_reset_scroll_info (source_device); |
||||
|
||||
clutter_event_set_device (event, device); |
||||
clutter_event_set_source_device (event, source_device); |
||||
-- |
||||
2.14.3 |
||||
|
@ -0,0 +1,317 @@
@@ -0,0 +1,317 @@
|
||||
From 8dfcfa0607754caab5032532ccc9d97b4393708e Mon Sep 17 00:00:00 2001 |
||||
From: Carlos Garnacho <carlosg@gnome.org> |
||||
Date: Fri, 29 Jun 2018 14:31:23 +0200 |
||||
Subject: [PATCH] clutter/x11: Implement keycode lookup from keysyms on virtual |
||||
key devices |
||||
|
||||
Unfortunately XKeysymToKeycode() falls short in that it coalesces keysyms |
||||
into keycodes pertaining to the first level (i.e. lowercase). Add a |
||||
ClutterKeymapX11 method (much alike its GdkKeymap counterpart) to look up |
||||
all matches for the given keysym. |
||||
|
||||
Two other helper methods have been added so the virtual device can fetch |
||||
the current keyboard group, and latch modifiers for key emission. Combining |
||||
all this, the virtual device is now able to handle keycodes in further |
||||
levels. |
||||
|
||||
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/135 |
||||
|
||||
(cherry picked from commit 85284acb000ddc70afcf716b6c198b4b5bf5741e) |
||||
--- |
||||
clutter/clutter/x11/clutter-keymap-x11.c | 178 +++++++++++++++++- |
||||
clutter/clutter/x11/clutter-keymap-x11.h | 8 + |
||||
.../x11/clutter-virtual-input-device-x11.c | 22 ++- |
||||
3 files changed, 204 insertions(+), 4 deletions(-) |
||||
|
||||
diff --git a/clutter/clutter/x11/clutter-keymap-x11.c b/clutter/clutter/x11/clutter-keymap-x11.c |
||||
index 914e31434..c34e676a4 100644 |
||||
--- a/clutter/clutter/x11/clutter-keymap-x11.c |
||||
+++ b/clutter/clutter/x11/clutter-keymap-x11.c |
||||
@@ -38,6 +38,14 @@ |
||||
|
||||
typedef struct _ClutterKeymapX11Class ClutterKeymapX11Class; |
||||
typedef struct _DirectionCacheEntry DirectionCacheEntry; |
||||
+typedef struct _ClutterKeymapKey ClutterKeymapKey; |
||||
+ |
||||
+struct _ClutterKeymapKey |
||||
+{ |
||||
+ guint keycode; |
||||
+ guint group; |
||||
+ guint level; |
||||
+}; |
||||
|
||||
struct _DirectionCacheEntry |
||||
{ |
||||
@@ -59,6 +67,7 @@ struct _ClutterKeymapX11 |
||||
|
||||
ClutterModifierType num_lock_mask; |
||||
ClutterModifierType scroll_lock_mask; |
||||
+ ClutterModifierType level3_shift_mask; |
||||
|
||||
PangoDirection current_direction; |
||||
|
||||
@@ -69,6 +78,7 @@ struct _ClutterKeymapX11 |
||||
Atom current_group_atom; |
||||
guint current_cache_serial; |
||||
DirectionCacheEntry group_direction_cache[4]; |
||||
+ int current_group; |
||||
#endif |
||||
|
||||
guint caps_lock_state : 1; |
||||
@@ -198,6 +208,9 @@ get_xkb (ClutterKeymapX11 *keymap_x11) |
||||
if (keymap_x11->scroll_lock_mask == 0) |
||||
keymap_x11->scroll_lock_mask = XkbKeysymToModifiers (backend_x11->xdpy, |
||||
XK_Scroll_Lock); |
||||
+ if (keymap_x11->level3_shift_mask == 0) |
||||
+ keymap_x11->level3_shift_mask = XkbKeysymToModifiers (backend_x11->xdpy, |
||||
+ XK_ISO_Level3_Shift); |
||||
|
||||
return keymap_x11->xkb_desc; |
||||
} |
||||
@@ -469,6 +482,7 @@ static void |
||||
clutter_keymap_x11_init (ClutterKeymapX11 *keymap) |
||||
{ |
||||
keymap->current_direction = PANGO_DIRECTION_NEUTRAL; |
||||
+ keymap->current_group = -1; |
||||
} |
||||
|
||||
static ClutterTranslateReturn |
||||
@@ -498,7 +512,8 @@ clutter_keymap_x11_translate_event (ClutterEventTranslator *translator, |
||||
{ |
||||
case XkbStateNotify: |
||||
CLUTTER_NOTE (EVENT, "Updating keyboard state"); |
||||
- update_direction (keymap_x11, XkbStateGroup (&xkb_event->state)); |
||||
+ keymap_x11->current_group = XkbStateGroup (&xkb_event->state); |
||||
+ update_direction (keymap_x11, keymap_x11->current_group); |
||||
update_locked_mods (keymap_x11, xkb_event->state.locked_mods); |
||||
retval = CLUTTER_TRANSLATE_REMOVE; |
||||
break; |
||||
@@ -665,3 +680,164 @@ _clutter_keymap_x11_get_direction (ClutterKeymapX11 *keymap) |
||||
#endif |
||||
return PANGO_DIRECTION_NEUTRAL; |
||||
} |
||||
+ |
||||
+static gboolean |
||||
+clutter_keymap_x11_get_entries_for_keyval (ClutterKeymapX11 *keymap_x11, |
||||
+ guint keyval, |
||||
+ ClutterKeymapKey **keys, |
||||
+ gint *n_keys) |
||||
+{ |
||||
+#ifdef HAVE_XKB |
||||
+ if (CLUTTER_BACKEND_X11 (keymap_x11->backend)->use_xkb) |
||||
+ { |
||||
+ XkbDescRec *xkb = get_xkb (keymap_x11); |
||||
+ GArray *retval; |
||||
+ gint keycode; |
||||
+ |
||||
+ keycode = keymap_x11->min_keycode; |
||||
+ retval = g_array_new (FALSE, FALSE, sizeof (ClutterKeymapKey)); |
||||
+ |
||||
+ while (keycode <= keymap_x11->max_keycode) |
||||
+ { |
||||
+ gint max_shift_levels = XkbKeyGroupsWidth (xkb, keycode); |
||||
+ gint group = 0; |
||||
+ gint level = 0; |
||||
+ gint total_syms = XkbKeyNumSyms (xkb, keycode); |
||||
+ gint i = 0; |
||||
+ KeySym *entry; |
||||
+ |
||||
+ /* entry is an array with all syms for group 0, all |
||||
+ * syms for group 1, etc. and for each group the |
||||
+ * shift level syms are in order |
||||
+ */ |
||||
+ entry = XkbKeySymsPtr (xkb, keycode); |
||||
+ |
||||
+ while (i < total_syms) |
||||
+ { |
||||
+ g_assert (i == (group * max_shift_levels + level)); |
||||
+ |
||||
+ if (entry[i] == keyval) |
||||
+ { |
||||
+ ClutterKeymapKey key; |
||||
+ |
||||
+ key.keycode = keycode; |
||||
+ key.group = group; |
||||
+ key.level = level; |
||||
+ |
||||
+ g_array_append_val (retval, key); |
||||
+ |
||||
+ g_assert (XkbKeySymEntry (xkb, keycode, level, group) == |
||||
+ keyval); |
||||
+ } |
||||
+ |
||||
+ ++level; |
||||
+ |
||||
+ if (level == max_shift_levels) |
||||
+ { |
||||
+ level = 0; |
||||
+ ++group; |
||||
+ } |
||||
+ |
||||
+ ++i; |
||||
+ } |
||||
+ |
||||
+ ++keycode; |
||||
+ } |
||||
+ |
||||
+ if (retval->len > 0) |
||||
+ { |
||||
+ *keys = (ClutterKeymapKey*) retval->data; |
||||
+ *n_keys = retval->len; |
||||
+ } |
||||
+ else |
||||
+ { |
||||
+ *keys = NULL; |
||||
+ *n_keys = 0; |
||||
+ } |
||||
+ |
||||
+ g_array_free (retval, retval->len > 0 ? FALSE : TRUE); |
||||
+ |
||||
+ return *n_keys > 0; |
||||
+ } |
||||
+ else |
||||
+#endif |
||||
+ { |
||||
+ return FALSE; |
||||
+ } |
||||
+} |
||||
+ |
||||
+void |
||||
+clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11, |
||||
+ uint32_t level, |
||||
+ gboolean enable) |
||||
+{ |
||||
+#ifdef HAVE_XKB |
||||
+ ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (keymap_x11->backend); |
||||
+ uint32_t modifiers[] = { |
||||
+ 0, |
||||
+ ShiftMask, |
||||
+ keymap_x11->level3_shift_mask, |
||||
+ keymap_x11->level3_shift_mask | ShiftMask, |
||||
+ }; |
||||
+ uint32_t value = 0; |
||||
+ |
||||
+ if (!backend_x11->use_xkb) |
||||
+ return; |
||||
+ |
||||
+ level = CLAMP (level, 0, G_N_ELEMENTS (modifiers) - 1); |
||||
+ |
||||
+ if (enable) |
||||
+ value = modifiers[level]; |
||||
+ else |
||||
+ value = 0; |
||||
+ |
||||
+ XkbLatchModifiers (clutter_x11_get_default_display (), |
||||
+ XkbUseCoreKbd, modifiers[level], |
||||
+ value); |
||||
+#endif |
||||
+} |
||||
+ |
||||
+static uint32_t |
||||
+clutter_keymap_x11_get_current_group (ClutterKeymapX11 *keymap_x11) |
||||
+{ |
||||
+ ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (keymap_x11->backend); |
||||
+ XkbStateRec state_rec; |
||||
+ |
||||
+ if (keymap_x11->current_group >= 0) |
||||
+ return keymap_x11->current_group; |
||||
+ |
||||
+ XkbGetState (backend_x11->xdpy, XkbUseCoreKbd, &state_rec); |
||||
+ return XkbStateGroup (&state_rec); |
||||
+} |
||||
+ |
||||
+gboolean |
||||
+clutter_keymap_x11_keycode_for_keyval (ClutterKeymapX11 *keymap_x11, |
||||
+ guint keyval, |
||||
+ guint *keycode_out, |
||||
+ guint *level_out) |
||||
+{ |
||||
+ ClutterKeymapKey *keys; |
||||
+ gint i, n_keys, group; |
||||
+ gboolean found = FALSE; |
||||
+ |
||||
+ g_return_val_if_fail (keycode_out != NULL, FALSE); |
||||
+ g_return_val_if_fail (level_out != NULL, FALSE); |
||||
+ |
||||
+ group = clutter_keymap_x11_get_current_group (keymap_x11); |
||||
+ |
||||
+ if (!clutter_keymap_x11_get_entries_for_keyval (keymap_x11, keyval, &keys, &n_keys)) |
||||
+ return FALSE; |
||||
+ |
||||
+ for (i = 0; i < n_keys && !found; i++) |
||||
+ { |
||||
+ if (keys[i].group == group) |
||||
+ { |
||||
+ *keycode_out = keys[i].keycode; |
||||
+ *level_out = keys[i].level; |
||||
+ found = TRUE; |
||||
+ } |
||||
+ } |
||||
+ |
||||
+ g_free (keys); |
||||
+ return found; |
||||
+} |
||||
diff --git a/clutter/clutter/x11/clutter-keymap-x11.h b/clutter/clutter/x11/clutter-keymap-x11.h |
||||
index ad673a2a7..4b5b403c8 100644 |
||||
--- a/clutter/clutter/x11/clutter-keymap-x11.h |
||||
+++ b/clutter/clutter/x11/clutter-keymap-x11.h |
||||
@@ -51,6 +51,14 @@ gboolean _clutter_keymap_x11_get_is_modifier (ClutterKeymapX11 *keymap, |
||||
|
||||
PangoDirection _clutter_keymap_x11_get_direction (ClutterKeymapX11 *keymap); |
||||
|
||||
+gboolean clutter_keymap_x11_keycode_for_keyval (ClutterKeymapX11 *keymap_x11, |
||||
+ guint keyval, |
||||
+ guint *keycode_out, |
||||
+ guint *level_out); |
||||
+void clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11, |
||||
+ uint32_t level, |
||||
+ gboolean enable); |
||||
+ |
||||
G_END_DECLS |
||||
|
||||
#endif /* __CLUTTER_KEYMAP_X11_H__ */ |
||||
diff --git a/clutter/clutter/x11/clutter-virtual-input-device-x11.c b/clutter/clutter/x11/clutter-virtual-input-device-x11.c |
||||
index 416c944b3..b86ded0d0 100644 |
||||
--- a/clutter/clutter/x11/clutter-virtual-input-device-x11.c |
||||
+++ b/clutter/clutter/x11/clutter-virtual-input-device-x11.c |
||||
@@ -32,6 +32,8 @@ |
||||
|
||||
#include "clutter-virtual-input-device.h" |
||||
#include "x11/clutter-virtual-input-device-x11.h" |
||||
+#include "x11/clutter-backend-x11.h" |
||||
+#include "x11/clutter-keymap-x11.h" |
||||
|
||||
struct _ClutterVirtualInputDeviceX11 |
||||
{ |
||||
@@ -135,11 +137,25 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu |
||||
uint32_t keyval, |
||||
ClutterKeyState key_state) |
||||
{ |
||||
- KeyCode keycode; |
||||
+ ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ()); |
||||
+ ClutterKeymapX11 *keymap = backend_x11->keymap; |
||||
+ uint32_t keycode, level; |
||||
+ |
||||
+ if (!clutter_keymap_x11_keycode_for_keyval (keymap, keyval, &keycode, &level)) |
||||
+ { |
||||
+ g_warning ("No keycode found for keyval %x in current group", keyval); |
||||
+ return; |
||||
+ } |
||||
+ |
||||
+ if (key_state == CLUTTER_KEY_STATE_PRESSED) |
||||
+ clutter_keymap_x11_latch_modifiers (keymap, level, TRUE); |
||||
|
||||
- keycode = XKeysymToKeycode (clutter_x11_get_default_display (), keyval); |
||||
XTestFakeKeyEvent (clutter_x11_get_default_display (), |
||||
- keycode, key_state == CLUTTER_KEY_STATE_PRESSED, 0); |
||||
+ (KeyCode) keycode, |
||||
+ key_state == CLUTTER_KEY_STATE_PRESSED, 0); |
||||
+ |
||||
+ if (key_state == CLUTTER_KEY_STATE_RELEASED) |
||||
+ clutter_keymap_x11_latch_modifiers (keymap, level, FALSE); |
||||
} |
||||
|
||||
static void |
||||
-- |
||||
2.19.0.rc0 |
||||
|
@ -0,0 +1,505 @@
@@ -0,0 +1,505 @@
|
||||
From 0cc90f343f4caadb5c4279623a0811c378715a09 Mon Sep 17 00:00:00 2001 |
||||
From: rpm-build <rpm-build> |
||||
Date: Tue, 11 Sep 2018 10:19:44 -0400 |
||||
Subject: [PATCH] monitor-manager: only reuse initial-config if monitor |
||||
topology matches startup |
||||
|
||||
Right now we try to apply the current monitor config when a new |
||||
monitor is attached. The current config obviously doesn't include the |
||||
new monitor, so the new monitor isn't lit up. |
||||
|
||||
The only reason we apply the current config at all is to handle the |
||||
startup case: We want to reuse the config set in Xorg when first |
||||
logging in. |
||||
|
||||
This commit changes the code to look at the *initial config* instead |
||||
of the current config, and only if the new monitor topology matches |
||||
the start up topology. |
||||
--- |
||||
src/backends/meta-monitor-config-manager.c | 20 +++++++++++++++----- |
||||
src/backends/meta-monitor-config-manager.h | 2 +- |
||||
src/backends/meta-monitor-manager.c | 16 +++++++++++++++- |
||||
3 files changed, 31 insertions(+), 7 deletions(-) |
||||
|
||||
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c |
||||
index 585ee7034..1ad342a44 100644 |
||||
--- a/src/backends/meta-monitor-config-manager.c |
||||
+++ b/src/backends/meta-monitor-config-manager.c |
||||
@@ -13,60 +13,61 @@ |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program; if not, write to the Free Software |
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
||||
* 02111-1307, USA. |
||||
*/ |
||||
|
||||
#include "config.h" |
||||
|
||||
#include "backends/meta-monitor-config-manager.h" |
||||
|
||||
#include "backends/meta-monitor-config-migration.h" |
||||
#include "backends/meta-monitor-config-store.h" |
||||
#include "backends/meta-monitor-manager-private.h" |
||||
#include "backends/meta-output.h" |
||||
#include "core/boxes-private.h" |
||||
|
||||
#define CONFIG_HISTORY_MAX_SIZE 3 |
||||
|
||||
struct _MetaMonitorConfigManager |
||||
{ |
||||
GObject parent; |
||||
|
||||
MetaMonitorManager *monitor_manager; |
||||
|
||||
MetaMonitorConfigStore *config_store; |
||||
|
||||
MetaMonitorsConfig *current_config; |
||||
+ MetaMonitorsConfig *initial_config; |
||||
GQueue config_history; |
||||
}; |
||||
|
||||
G_DEFINE_TYPE (MetaMonitorConfigManager, meta_monitor_config_manager, |
||||
G_TYPE_OBJECT) |
||||
|
||||
G_DEFINE_TYPE (MetaMonitorsConfig, meta_monitors_config, |
||||
G_TYPE_OBJECT) |
||||
|
||||
static void |
||||
meta_crtc_info_free (MetaCrtcInfo *info); |
||||
|
||||
static void |
||||
meta_output_info_free (MetaOutputInfo *info); |
||||
|
||||
MetaMonitorConfigManager * |
||||
meta_monitor_config_manager_new (MetaMonitorManager *monitor_manager) |
||||
{ |
||||
MetaMonitorConfigManager *config_manager; |
||||
|
||||
config_manager = g_object_new (META_TYPE_MONITOR_CONFIG_MANAGER, NULL); |
||||
config_manager->monitor_manager = monitor_manager; |
||||
config_manager->config_store = |
||||
meta_monitor_config_store_new (monitor_manager); |
||||
|
||||
return config_manager; |
||||
} |
||||
|
||||
MetaMonitorConfigStore * |
||||
meta_monitor_config_manager_get_store (MetaMonitorConfigManager *config_manager) |
||||
@@ -552,115 +553,123 @@ create_preferred_logical_monitor_config (MetaMonitorManager *monitor_ma |
||||
.width = width, |
||||
.height = height |
||||
}, |
||||
.scale = scale, |
||||
.monitor_configs = g_list_append (NULL, monitor_config) |
||||
}; |
||||
|
||||
return logical_monitor_config; |
||||
} |
||||
|
||||
static MetaLogicalMonitorConfig * |
||||
create_logical_monitor_config_from_output (MetaMonitorManager *monitor_manager, |
||||
MetaMonitor *monitor, |
||||
MetaLogicalMonitorConfig *primary_logical_monitor_config, |
||||
MetaLogicalMonitorLayoutMode layout_mode) |
||||
{ |
||||
MetaOutput *output; |
||||
MetaCrtc *crtc; |
||||
|
||||
output = meta_monitor_get_main_output (monitor); |
||||
crtc = meta_output_get_assigned_crtc (output); |
||||
return create_preferred_logical_monitor_config (monitor_manager, |
||||
monitor, |
||||
crtc->rect.x, |
||||
crtc->rect.y, |
||||
primary_logical_monitor_config, |
||||
layout_mode); |
||||
} |
||||
|
||||
MetaMonitorsConfig * |
||||
-meta_monitor_config_manager_create_current (MetaMonitorConfigManager *config_manager) |
||||
+meta_monitor_config_manager_create_initial (MetaMonitorConfigManager *config_manager) |
||||
{ |
||||
MetaMonitorManager *monitor_manager = config_manager->monitor_manager; |
||||
+ MetaMonitorsConfig *initial_config; |
||||
GList *logical_monitor_configs; |
||||
MetaMonitor *primary_monitor; |
||||
MetaLogicalMonitorLayoutMode layout_mode; |
||||
MetaLogicalMonitorConfig *primary_logical_monitor_config; |
||||
GList *monitors; |
||||
GList *l; |
||||
|
||||
+ if (config_manager->initial_config != NULL) |
||||
+ return g_object_ref (config_manager->initial_config); |
||||
+ |
||||
if (meta_monitor_config_store_get_config_count (config_manager->config_store) > 0) |
||||
return NULL; |
||||
|
||||
primary_monitor = find_primary_monitor (monitor_manager); |
||||
if (!primary_monitor || !meta_monitor_is_active (primary_monitor)) |
||||
return NULL; |
||||
|
||||
layout_mode = meta_monitor_manager_get_default_layout_mode (monitor_manager); |
||||
|
||||
primary_logical_monitor_config = |
||||
create_logical_monitor_config_from_output (monitor_manager, |
||||
primary_monitor, |
||||
NULL, |
||||
layout_mode); |
||||
|
||||
primary_logical_monitor_config->is_primary = TRUE; |
||||
logical_monitor_configs = g_list_append (NULL, |
||||
primary_logical_monitor_config); |
||||
|
||||
monitors = meta_monitor_manager_get_monitors (monitor_manager); |
||||
for (l = monitors; l; l = l->next) |
||||
{ |
||||
MetaMonitor *monitor = l->data; |
||||
MetaLogicalMonitorConfig *logical_monitor_config; |
||||
|
||||
if (monitor == primary_monitor) |
||||
continue; |
||||
|
||||
if (!meta_monitor_is_active (monitor)) |
||||
continue; |
||||
|
||||
logical_monitor_config = |
||||
create_logical_monitor_config_from_output (monitor_manager, |
||||
monitor, |
||||
primary_logical_monitor_config, |
||||
layout_mode); |
||||
|
||||
logical_monitor_configs = g_list_append (logical_monitor_configs, |
||||
logical_monitor_config); |
||||
} |
||||
|
||||
- return meta_monitors_config_new (monitor_manager, |
||||
- logical_monitor_configs, |
||||
- layout_mode, |
||||
- META_MONITORS_CONFIG_FLAG_NONE); |
||||
+ initial_config = meta_monitors_config_new (monitor_manager, |
||||
+ logical_monitor_configs, |
||||
+ layout_mode, |
||||
+ META_MONITORS_CONFIG_FLAG_NONE); |
||||
+ |
||||
+ config_manager->initial_config = g_object_ref (initial_config); |
||||
+ |
||||
+ return initial_config; |
||||
} |
||||
|
||||
MetaMonitorsConfig * |
||||
meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_manager) |
||||
{ |
||||
MetaMonitorManager *monitor_manager = config_manager->monitor_manager; |
||||
GList *logical_monitor_configs; |
||||
MetaMonitor *primary_monitor; |
||||
MetaLogicalMonitorLayoutMode layout_mode; |
||||
MetaLogicalMonitorConfig *primary_logical_monitor_config; |
||||
int x; |
||||
GList *monitors; |
||||
GList *l; |
||||
|
||||
primary_monitor = find_primary_monitor (monitor_manager); |
||||
if (!primary_monitor) |
||||
return NULL; |
||||
|
||||
layout_mode = meta_monitor_manager_get_default_layout_mode (monitor_manager); |
||||
|
||||
primary_logical_monitor_config = |
||||
create_preferred_logical_monitor_config (monitor_manager, |
||||
primary_monitor, |
||||
0, 0, |
||||
NULL, |
||||
layout_mode); |
||||
primary_logical_monitor_config->is_primary = TRUE; |
||||
logical_monitor_configs = g_list_append (NULL, |
||||
primary_logical_monitor_config); |
||||
|
||||
@@ -1135,60 +1144,61 @@ meta_monitor_config_manager_get_current (MetaMonitorConfigManager *config_manage |
||||
{ |
||||
return config_manager->current_config; |
||||
} |
||||
|
||||
MetaMonitorsConfig * |
||||
meta_monitor_config_manager_pop_previous (MetaMonitorConfigManager *config_manager) |
||||
{ |
||||
return g_queue_pop_head (&config_manager->config_history); |
||||
} |
||||
|
||||
MetaMonitorsConfig * |
||||
meta_monitor_config_manager_get_previous (MetaMonitorConfigManager *config_manager) |
||||
{ |
||||
return g_queue_peek_head (&config_manager->config_history); |
||||
} |
||||
|
||||
void |
||||
meta_monitor_config_manager_clear_history (MetaMonitorConfigManager *config_manager) |
||||
{ |
||||
g_queue_foreach (&config_manager->config_history, (GFunc) g_object_unref, NULL); |
||||
g_queue_clear (&config_manager->config_history); |
||||
} |
||||
|
||||
static void |
||||
meta_monitor_config_manager_dispose (GObject *object) |
||||
{ |
||||
MetaMonitorConfigManager *config_manager = |
||||
META_MONITOR_CONFIG_MANAGER (object); |
||||
|
||||
g_clear_object (&config_manager->current_config); |
||||
+ g_clear_object (&config_manager->initial_config); |
||||
meta_monitor_config_manager_clear_history (config_manager); |
||||
|
||||
G_OBJECT_CLASS (meta_monitor_config_manager_parent_class)->dispose (object); |
||||
} |
||||
|
||||
static void |
||||
meta_monitor_config_manager_init (MetaMonitorConfigManager *config_manager) |
||||
{ |
||||
g_queue_init (&config_manager->config_history); |
||||
} |
||||
|
||||
static void |
||||
meta_monitor_config_manager_class_init (MetaMonitorConfigManagerClass *klass) |
||||
{ |
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass); |
||||
|
||||
object_class->dispose = meta_monitor_config_manager_dispose; |
||||
} |
||||
|
||||
void |
||||
meta_monitor_config_free (MetaMonitorConfig *monitor_config) |
||||
{ |
||||
meta_monitor_spec_free (monitor_config->monitor_spec); |
||||
g_free (monitor_config->mode_spec); |
||||
g_free (monitor_config); |
||||
} |
||||
|
||||
void |
||||
meta_logical_monitor_config_free (MetaLogicalMonitorConfig *logical_monitor_config) |
||||
{ |
||||
diff --git a/src/backends/meta-monitor-config-manager.h b/src/backends/meta-monitor-config-manager.h |
||||
index c36df38e6..29ef8f8ce 100644 |
||||
--- a/src/backends/meta-monitor-config-manager.h |
||||
+++ b/src/backends/meta-monitor-config-manager.h |
||||
@@ -60,61 +60,61 @@ typedef enum _MetaMonitorsConfigFlag |
||||
struct _MetaMonitorsConfig |
||||
{ |
||||
GObject parent; |
||||
|
||||
MetaMonitorsConfigKey *key; |
||||
GList *logical_monitor_configs; |
||||
|
||||
GList *disabled_monitor_specs; |
||||
|
||||
MetaMonitorsConfigFlag flags; |
||||
|
||||
MetaLogicalMonitorLayoutMode layout_mode; |
||||
}; |
||||
|
||||
#define META_TYPE_MONITORS_CONFIG (meta_monitors_config_get_type ()) |
||||
G_DECLARE_FINAL_TYPE (MetaMonitorsConfig, meta_monitors_config, |
||||
META, MONITORS_CONFIG, GObject) |
||||
|
||||
MetaMonitorConfigManager * meta_monitor_config_manager_new (MetaMonitorManager *monitor_manager); |
||||
|
||||
MetaMonitorConfigStore * meta_monitor_config_manager_get_store (MetaMonitorConfigManager *config_manager); |
||||
|
||||
gboolean meta_monitor_config_manager_assign (MetaMonitorManager *manager, |
||||
MetaMonitorsConfig *config, |
||||
GPtrArray **crtc_infos, |
||||
GPtrArray **output_infos, |
||||
GError **error); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_get_stored (MetaMonitorConfigManager *config_manager); |
||||
|
||||
-MetaMonitorsConfig * meta_monitor_config_manager_create_current (MetaMonitorConfigManager *config_manager); |
||||
+MetaMonitorsConfig * meta_monitor_config_manager_create_initial (MetaMonitorConfigManager *config_manager); |
||||
MetaMonitorsConfig * meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_manager); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_create_fallback (MetaMonitorConfigManager *config_manager); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_create_suggested (MetaMonitorConfigManager *config_manager); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_create_for_orientation (MetaMonitorConfigManager *config_manager, |
||||
MetaMonitorTransform transform); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_create_for_rotate_monitor (MetaMonitorConfigManager *config_manager); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_create_for_switch_config (MetaMonitorConfigManager *config_manager, |
||||
MetaMonitorSwitchConfigType config_type); |
||||
|
||||
void meta_monitor_config_manager_set_current (MetaMonitorConfigManager *config_manager, |
||||
MetaMonitorsConfig *config); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_get_current (MetaMonitorConfigManager *config_manager); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_pop_previous (MetaMonitorConfigManager *config_manager); |
||||
|
||||
MetaMonitorsConfig * meta_monitor_config_manager_get_previous (MetaMonitorConfigManager *config_manager); |
||||
|
||||
void meta_monitor_config_manager_clear_history (MetaMonitorConfigManager *config_manager); |
||||
|
||||
void meta_monitor_config_manager_save_current (MetaMonitorConfigManager *config_manager); |
||||
|
||||
MetaMonitorsConfig * meta_monitors_config_new_full (GList *logical_monitor_configs, |
||||
GList *disabled_monitors, |
||||
MetaLogicalMonitorLayoutMode layout_mode, |
||||
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c |
||||
index 4503eb841..f7ada0136 100644 |
||||
--- a/src/backends/meta-monitor-manager.c |
||||
+++ b/src/backends/meta-monitor-manager.c |
||||
@@ -469,73 +469,87 @@ meta_monitor_manager_apply_monitors_config (MetaMonitorManager *manager, |
||||
|
||||
return TRUE; |
||||
} |
||||
|
||||
gboolean |
||||
meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager) |
||||
{ |
||||
GList *l; |
||||
|
||||
for (l = manager->gpus; l; l = l->next) |
||||
{ |
||||
MetaGpu *gpu = l->data; |
||||
|
||||
if (meta_gpu_has_hotplug_mode_update (gpu)) |
||||
return TRUE; |
||||
} |
||||
|
||||
return FALSE; |
||||
} |
||||
|
||||
static gboolean |
||||
should_use_stored_config (MetaMonitorManager *manager) |
||||
{ |
||||
return (manager->in_init || |
||||
!meta_monitor_manager_has_hotplug_mode_update (manager)); |
||||
} |
||||
|
||||
MetaMonitorsConfig * |
||||
meta_monitor_manager_ensure_configured (MetaMonitorManager *manager) |
||||
{ |
||||
+ g_autoptr (MetaMonitorsConfig) initial_config = NULL; |
||||
MetaMonitorsConfig *config = NULL; |
||||
GError *error = NULL; |
||||
gboolean use_stored_config; |
||||
+ MetaMonitorsConfigKey *current_state_key; |
||||
MetaMonitorsConfigMethod method; |
||||
MetaMonitorsConfigMethod fallback_method = |
||||
META_MONITORS_CONFIG_METHOD_TEMPORARY; |
||||
|
||||
use_stored_config = should_use_stored_config (manager); |
||||
if (use_stored_config) |
||||
method = META_MONITORS_CONFIG_METHOD_PERSISTENT; |
||||
else |
||||
method = META_MONITORS_CONFIG_METHOD_TEMPORARY; |
||||
|
||||
+ initial_config = meta_monitor_config_manager_create_initial (manager->config_manager); |
||||
+ |
||||
+ if (initial_config) |
||||
+ { |
||||
+ current_state_key = meta_create_monitors_config_key_for_current_state (manager); |
||||
+ |
||||
+ /* don't ever reuse initial configuration, if the monitor topology changed |
||||
+ */ |
||||
+ if (current_state_key && !meta_monitors_config_key_equal (current_state_key, initial_config->key)) |
||||
+ g_clear_object (&initial_config); |
||||
+ } |
||||
+ |
||||
if (use_stored_config) |
||||
{ |
||||
config = meta_monitor_config_manager_get_stored (manager->config_manager); |
||||
if (config) |
||||
{ |
||||
if (!meta_monitor_manager_apply_monitors_config (manager, |
||||
config, |
||||
method, |
||||
&error)) |
||||
{ |
||||
config = NULL; |
||||
g_warning ("Failed to use stored monitor configuration: %s", |
||||
error->message); |
||||
g_clear_error (&error); |
||||
} |
||||
else |
||||
{ |
||||
g_object_ref (config); |
||||
goto done; |
||||
} |
||||
} |
||||
} |
||||
|
||||
config = meta_monitor_config_manager_create_suggested (manager->config_manager); |
||||
if (config) |
||||
{ |
||||
if (!meta_monitor_manager_apply_monitors_config (manager, |
||||
config, |
||||
method, |
||||
&error)) |
||||
@@ -549,61 +563,61 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager) |
||||
{ |
||||
goto done; |
||||
} |
||||
} |
||||
|
||||
config = meta_monitor_config_manager_get_previous (manager->config_manager); |
||||
if (config) |
||||
{ |
||||
config = g_object_ref (config); |
||||
|
||||
if (meta_monitor_manager_is_config_complete (manager, config)) |
||||
{ |
||||
if (!meta_monitor_manager_apply_monitors_config (manager, |
||||
config, |
||||
method, |
||||
&error)) |
||||
{ |
||||
g_warning ("Failed to use suggested monitor configuration: %s", |
||||
error->message); |
||||
g_clear_error (&error); |
||||
} |
||||
else |
||||
{ |
||||
goto done; |
||||
} |
||||
} |
||||
|
||||
g_clear_object (&config); |
||||
} |
||||
|
||||
- config = meta_monitor_config_manager_create_current (manager->config_manager); |
||||
+ config = g_steal_pointer (&initial_config); |
||||
if (config) |
||||
{ |
||||
if (!meta_monitor_manager_apply_monitors_config (manager, |
||||
config, |
||||
method, |
||||
&error)) |
||||
{ |
||||
g_clear_object (&config); |
||||
g_warning ("Failed to use current monitor configuration: %s", |
||||
error->message); |
||||
g_clear_error (&error); |
||||
} |
||||
else |
||||
{ |
||||
goto done; |
||||
} |
||||
} |
||||
|
||||
config = meta_monitor_config_manager_create_linear (manager->config_manager); |
||||
if (config) |
||||
{ |
||||
if (!meta_monitor_manager_apply_monitors_config (manager, |
||||
config, |
||||
method, |
||||
&error)) |
||||
{ |
||||
g_clear_object (&config); |
||||
g_warning ("Failed to use linear monitor configuration: %s", |
||||
error->message); |
||||
g_clear_error (&error); |
||||
-- |
||||
2.17.1 |
||||
|
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
From 33bf5319baec86e6caef5b94c71db8101fb94343 Mon Sep 17 00:00:00 2001 |
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> |
||||
Date: Fri, 25 May 2018 20:18:23 +0200 |
||||
Subject: [PATCH 1/2] window: Don't refuse to move focus to the grab window |
||||
|
||||
We refuse to move focus while a grab operation is in place. While this |
||||
generally makes sense, there's no reason why the window that owns the |
||||
grab shouldn't be given the regular input focus as well - we pretty |
||||
much assume that the grab window is also the focus window anyway. |
||||
|
||||
In fact there's a strong reason for allowing the focus change here: |
||||
If the grab window isn't the focus window, it probably has a modal |
||||
transient that is focused instead, and a likely reason for the focus |
||||
request is that the transient is being unmanaged and we must move |
||||
the focus elsewhere. |
||||
|
||||
https://gitlab.gnome.org/GNOME/mutter/issues/15 |
||||
--- |
||||
src/core/window.c | 1 + |
||||
1 file changed, 1 insertion(+) |
||||
|
||||
diff --git a/src/core/window.c b/src/core/window.c |
||||
index 743326c60..5b1eb5b68 100644 |
||||
--- a/src/core/window.c |
||||
+++ b/src/core/window.c |
||||
@@ -4620,6 +4620,7 @@ meta_window_focus (MetaWindow *window, |
||||
window->desc, window->input, window->take_focus); |
||||
|
||||
if (window->display->grab_window && |
||||
+ window->display->grab_window != window && |
||||
window->display->grab_window->all_keys_grabbed && |
||||
!window->display->grab_window->unmanaging) |
||||
{ |
||||
-- |
||||
2.17.1 |
||||
|
||||
|
||||
From 149ae05df628480e8226f035044e6020305a8aeb Mon Sep 17 00:00:00 2001 |
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> |
||||
Date: Fri, 25 May 2018 21:24:17 +0200 |
||||
Subject: [PATCH 2/2] window: Explicitly exclude unmanaging window from focus |
||||
again |
||||
|
||||
Since commit b3b9d9e16 we no longer have to pass the unmanaging window |
||||
to make sure we don't try to focus it again, however the parameter also |
||||
influences the focus policy by giving ancestors preference over the normal |
||||
stack order. |
||||
|
||||
https://gitlab.gnome.org/GNOME/mutter/issues/15 |
||||
--- |
||||
src/core/window.c | 4 +++- |
||||
1 file changed, 3 insertions(+), 1 deletion(-) |
||||
|
||||
diff --git a/src/core/window.c b/src/core/window.c |
||||
index 5b1eb5b68..cc0813ac4 100644 |
||||
--- a/src/core/window.c |
||||
+++ b/src/core/window.c |
||||
@@ -1469,7 +1469,9 @@ meta_window_unmanage (MetaWindow *window, |
||||
meta_topic (META_DEBUG_FOCUS, |
||||
"Focusing default window since we're unmanaging %s\n", |
||||
window->desc); |
||||
- meta_workspace_focus_default_window (window->screen->active_workspace, NULL, timestamp); |
||||
+ meta_workspace_focus_default_window (window->screen->active_workspace, |
||||
+ window, |
||||
+ timestamp); |
||||
} |
||||
else |
||||
{ |
||||
-- |
||||
2.17.1 |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue