[gnome-shell/wip/focus-management: 6/8] global: Automatically unshape the stage X window when we take a modal



commit 0a5eff977c18337348bc900c17802784aa752e69
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sat May 18 18:54:44 2013 -0400

    global: Automatically unshape the stage X window when we take a modal
    
    This prevents the "client" from having to do it, and removes one part
    of the FULLSCREEN input mode.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700735

 js/ui/main.js      |    4 ----
 src/shell-global.c |    4 +++-
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 0774b3a..1bd61b7 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -356,8 +356,6 @@ function pushModal(actor, params) {
         Meta.disable_unredirect_for_screen(global.screen);
     }
 
-    global.set_stage_input_mode(Shell.StageInputMode.FULLSCREEN);
-
     modalCount += 1;
     let actorDestroyId = actor.connect('destroy', function() {
         let index = _findModal(actor);
@@ -406,7 +404,6 @@ function popModal(actor, timestamp) {
     if (focusIndex < 0) {
         global.stage.set_key_focus(null);
         global.end_modal(timestamp);
-        global.set_stage_input_mode(Shell.StageInputMode.NORMAL);
         keybindingMode = Shell.KeyBindingMode.NORMAL;
 
         throw new Error('incorrect pop');
@@ -454,7 +451,6 @@ function popModal(actor, timestamp) {
         return;
 
     global.end_modal(timestamp);
-    global.set_stage_input_mode(Shell.StageInputMode.NORMAL);
     Meta.enable_unredirect_for_screen(global.screen);
     keybindingMode = Shell.KeyBindingMode.NORMAL;
 }
diff --git a/src/shell-global.c b/src/shell-global.c
index 1561fe0..62e0f61 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -601,7 +601,7 @@ sync_input_region (ShellGlobal *global)
 
   if (global->gtk_grab_active)
     meta_empty_stage_input_region (screen);
-  else if (global->input_mode == SHELL_STAGE_INPUT_MODE_FULLSCREEN || !global->input_region)
+  else if (global->input_mode == SHELL_STAGE_INPUT_MODE_FULLSCREEN || !global->input_region || 
global->has_modal)
     meta_set_stage_input_region (screen, None);
   else
     meta_set_stage_input_region (screen, global->input_region);
@@ -1040,6 +1040,7 @@ shell_global_begin_modal (ShellGlobal       *global,
     return FALSE;
 
   global->has_modal = meta_plugin_begin_modal (global->plugin, global->stage_xwindow, None, options, 
timestamp);
+  sync_input_region (global);
   return global->has_modal;
 }
 
@@ -1060,6 +1061,7 @@ shell_global_end_modal (ShellGlobal *global,
   global->has_modal = FALSE;
 
   sync_stage_window_focus (global);
+  sync_input_region (global);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]