]> Dogcows Code - chaz/openbox/commitdiff
Merge branch 'backport' into work
authorDana Jansens <danakj@orodu.net>
Tue, 8 Dec 2009 19:19:04 +0000 (14:19 -0500)
committerDana Jansens <danakj@orodu.net>
Tue, 8 Dec 2009 19:19:04 +0000 (14:19 -0500)
Conflicts:

openbox/actions/all.h
openbox/actions/session.c
openbox/client.c
openbox/event.c
openbox/grab.c

1  2 
Makefile.am
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/exit.c
openbox/client.c
openbox/client.h
openbox/event.c
openbox/focus.c
openbox/session.c

diff --cc Makefile.am
Simple merge
Simple merge
index 1f520b93f1a2d4abc130f86329274844737f1304,5f3f573f247a967e3c1e19f3b5c85b29a8584b7b..6acbc9cae5a0cc8693ae6d6546c0ea40e2cb318a
@@@ -1,46 -1,43 +1,45 @@@
  #ifndef __actions_all_h
  #define __actions_all_h
  
 -void action_all_startup();
 +void action_all_startup(void);
  
 -void action_execute_startup();
 -void action_debug_startup();
 -void action_showmenu_startup();
 -void action_showdesktop_startup();
 -void action_reconfigure_startup();
 -void action_exit_startup();
 -void action_restart_startup();
 -void action_cyclewindows_startup();
 -void action_breakchroot_startup();
 -void action_close_startup();
 -void action_move_startup();
 -void action_focus_startup();
 -void action_raise_startup();
 -void action_lower_startup();
 -void action_raiselower_startup();
 -void action_unfocus_startup();
 -void action_iconify_startup();
 -void action_fullscreen_startup();
 -void action_maximize_startup();
 -void action_moveresizeto_startup();
 -void action_moverelative_startup();
 -void action_shade_startup();
 -void action_kill_startup();
 -void action_omnipresent_startup();
 -void action_directionalwindows_startup();
 -void action_resize_startup();
 -void action_decorations_startup();
 -void action_desktop_startup();
 -void action_resizerelative_startup();
 -void action_addremovedesktop_startup();
 -void action_dockautohide_startup();
 -void action_layer_startup();
 -void action_movetoedge_startup();
 -void action_growtoedge_startup();
 -void action_if_startup();
 -void action_focustobottom_startup();
 +void action_execute_startup(void);
 +void action_debug_startup(void);
 +void action_showmenu_startup(void);
 +void action_showdesktop_startup(void);
 +void action_reconfigure_startup(void);
 +void action_exit_startup(void);
 +void action_restart_startup(void);
- void action_session_startup(void);
 +void action_cyclewindows_startup(void);
 +void action_breakchroot_startup(void);
 +void action_close_startup(void);
 +void action_move_startup(void);
 +void action_focus_startup(void);
 +void action_raise_startup(void);
 +void action_lower_startup(void);
 +void action_raiselower_startup(void);
 +void action_unfocus_startup(void);
 +void action_iconify_startup(void);
 +void action_fullscreen_startup(void);
 +void action_maximize_startup(void);
 +void action_moveresizeto_startup(void);
 +void action_moverelative_startup(void);
 +void action_shade_startup(void);
 +void action_kill_startup(void);
 +void action_omnipresent_startup(void);
 +void action_directionalwindows_startup(void);
 +void action_resize_startup(void);
 +void action_decorations_startup(void);
 +void action_desktop_startup(void);
 +void action_resizerelative_startup(void);
 +void action_addremovedesktop_startup(void);
 +void action_dockautohide_startup(void);
 +void action_layer_startup(void);
 +void action_movetoedge_startup(void);
 +void action_growtoedge_startup(void);
 +void action_if_startup(void);
 +void action_focustobottom_startup(void);
 +/* 3.4-compatibility */
 +void action_shadelowerraise_startup(void);
  
  #endif
index 4f8cce6e6c44517bd50d88eeeced98de3002db7c,567926e1fd3e4ddb8ba52c5a1cc25e8d927a5981..3bfebbce3175e60cca7fceec9a0272a4f35caa90
@@@ -13,9 -14,10 +14,10 @@@ static gboolean run_func(ObActionsData 
  void action_exit_startup(void)
  {
      actions_register("Exit", setup_func, NULL, run_func, NULL, NULL);
+     actions_register("SessionLogout", setup_func, NULL, run_func, NULL, NULL);
  }
  
 -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
 +static gpointer setup_func(xmlNodePtr node)
  {
      xmlNodePtr n;
      Options *o;
index fc087d44848f6f1547dd874113747f27f9497872,a91b9503e09ef62d9eb45321aa83fbc918f8de62..50a0dbeee956fc743e8a0423f75598ed5d4140e6
@@@ -415,124 -498,17 +417,17 @@@ void client_manage(Window window, ObPro
      g_free(monitor);
      monitor = NULL;
  
 -    ob_debug_type(OB_DEBUG_FOCUS, "Going to try activate new window? %s\n",
 +    ob_debug_type(OB_DEBUG_FOCUS, "Going to try activate new window? %s",
                    activate ? "yes" : "no");
      if (activate) {
-         gboolean raise = FALSE;
-         gboolean relative_focused;
-         gboolean parent_focused;
-         parent_focused = (focus_client != NULL &&
-                           client_search_focus_parent(self));
-         relative_focused = (focus_client != NULL &&
-                             (client_search_focus_tree_full(self) != NULL ||
-                              client_search_focus_group_full(self) != NULL));
-         /* This is focus stealing prevention */
-         ob_debug_type(OB_DEBUG_FOCUS,
-                       "Want to focus new window 0x%x at time %u "
-                       "launched at %u (last user interaction time %u)",
-                       self->window, map_time, launch_time,
-                       event_last_user_time);
-         ob_debug_type(OB_DEBUG_FOCUS,
-                       "Current focus_client: %s",
-                       (focus_client ? focus_client->title : "(none)"));
-         ob_debug_type(OB_DEBUG_FOCUS,
-                       "parent focused: %d  relative focused: %d",
-                       parent_focused, relative_focused);
-         if (menu_frame_visible || moveresize_in_progress) {
-             activate = FALSE;
-             raise = TRUE;
-             ob_debug_type(OB_DEBUG_FOCUS,
-                           "Not focusing the window because the user is inside "
-                           "an Openbox menu or is move/resizing a window and "
-                           "we don't want to interrupt them");
-         }
-         /* if it's on another desktop */
-         else if (!(self->desktop == screen_desktop ||
-                    self->desktop == DESKTOP_ALL) &&
-                  /* the timestamp is from before you changed desktops */
-                  launch_time && screen_desktop_user_time &&
-                  !event_time_after(launch_time, screen_desktop_user_time))
-         {
-             activate = FALSE;
-             raise = TRUE;
-             ob_debug_type(OB_DEBUG_FOCUS,
-                           "Not focusing the window because its on another "
-                           "desktop");
-         }
-         /* If something is focused... */
-         else if (focus_client) {
-             /* If the user is working in another window right now, then don't
-                steal focus */
-             if (!parent_focused &&
-                 event_last_user_time && launch_time &&
-                 event_time_after(event_last_user_time, launch_time) &&
-                 event_last_user_time != launch_time &&
-                 event_time_after(event_last_user_time,
-                                  map_time - OB_EVENT_USER_TIME_DELAY))
-             {
-                 activate = FALSE;
-                 ob_debug_type(OB_DEBUG_FOCUS,
-                               "Not focusing the window because the user is "
-                               "working in another window that is not "
-                               "its parent");
-             }
-             /* If the new window is a transient (and its relatives aren't
-                focused) */
-             else if (client_has_parent(self) && !relative_focused) {
-                 activate = FALSE;
-                 ob_debug_type(OB_DEBUG_FOCUS,
-                               "Not focusing the window because it is a "
-                               "transient, and its relatives aren't focused");
-             }
-             /* Don't steal focus from globally active clients.
-                I stole this idea from KWin. It seems nice.
-              */
-             else if (!(focus_client->can_focus ||
-                        focus_client->focus_notify))
-             {
-                 activate = FALSE;
-                 ob_debug_type(OB_DEBUG_FOCUS,
-                               "Not focusing the window because a globally "
-                               "active client has focus");
-             }
-             /* Don't move focus if it's not going to go to this window
-                anyway */
-             else if (client_focus_target(self) != self) {
-                 activate = FALSE;
-                 raise = TRUE;
-                 ob_debug_type(OB_DEBUG_FOCUS,
-                               "Not focusing the window because another window "
-                               "would get the focus anyway");
-             }
-             /* Don't move focus if the window is not visible on the current
-                desktop and none of its relatives are focused */
-             else if (!(self->desktop == screen_desktop ||
-                        self->desktop == DESKTOP_ALL) &&
-                      !relative_focused)
-             {
-                 activate = FALSE;
-                 raise = TRUE;
-                 ob_debug_type(OB_DEBUG_FOCUS,
-                               "Not focusing the window because it is on "
-                               "another desktop and no relatives are focused ");
-             }
-         }
+         activate = client_can_steal_focus(self, map_time, launch_time);
  
          if (!activate) {
-             ob_debug_type(OB_DEBUG_FOCUS,
-                           "Focus stealing prevention activated for %s at "
-                           "time %u (last user interaction time %u)",
-                           self->title, map_time, event_last_user_time);
-             /* if the client isn't focused, then hilite it so the user
-                knows it is there */
-             client_hilite(self, TRUE);
-             /* we may want to raise it even tho we're not activating it */
-             if (raise && !client_restore_session_stacking(self))
-                 stacking_raise(CLIENT_AS_WINDOW(self));
+             /* if the client isn't stealing focus, then hilite it so the user
+                knows it is there, but don't do this if we're restoring from a
+                session */
+             if (!client_restore_session_stacking(self))
+                 client_hilite(self, TRUE);
          }
      }
      else {
@@@ -781,6 -759,105 +676,105 @@@ void client_fake_unmanage(ObClient *sel
      g_free(self);
  }
  
 -                  "launched at %u (last user interaction time %u)\n",
+ static gboolean client_can_steal_focus(ObClient *self, Time steal_time,
+                                        Time launch_time)
+ {
+     gboolean steal;
+     gboolean relative_focused;
+     gboolean parent_focused;
+     steal = TRUE;
+     parent_focused = (focus_client != NULL &&
+                       client_search_focus_parent(self));
+     relative_focused = (focus_client != NULL &&
+                         (client_search_focus_tree_full(self) != NULL ||
+                          client_search_focus_group_full(self) != NULL));
+     /* This is focus stealing prevention */
+     ob_debug_type(OB_DEBUG_FOCUS,
+                   "Want to focus new window 0x%x at time %u "
 -                          "its parent\n");
++                  "launched at %u (last user interaction time %u)",
+                   self->window, steal_time, launch_time,
+                   event_last_user_time);
+     /* if it's on another desktop */
+     if (!(self->desktop == screen_desktop ||
+           self->desktop == DESKTOP_ALL) &&
+         /* the timestamp is from before you changed desktops */
+         launch_time && screen_desktop_user_time &&
+         !event_time_after(launch_time, screen_desktop_user_time))
+     {
+         steal = FALSE;
+         ob_debug_type(OB_DEBUG_FOCUS,
+                       "Not focusing the window because its on another "
+                       "desktop\n");
+     }
+     /* If something is focused... */
+     else if (focus_client) {
+         /* If the user is working in another window right now, then don't
+            steal focus */
+         if (!parent_focused &&
+             event_last_user_time && launch_time &&
+             event_time_after(event_last_user_time, launch_time) &&
+             event_last_user_time != launch_time &&
+             event_time_after(event_last_user_time,
+                              steal_time - OB_EVENT_USER_TIME_DELAY))
+         {
+             steal = FALSE;
+             ob_debug_type(OB_DEBUG_FOCUS,
+                           "Not focusing the window because the user is "
+                           "working in another window that is not "
 -                          "transient, and its relatives aren't focused\n");
++                          "its parent");
+         }
+         /* If the new window is a transient (and its relatives aren't
+            focused) */
+         else if (client_has_parent(self) && !relative_focused) {
+             steal = FALSE;
+             ob_debug_type(OB_DEBUG_FOCUS,
+                           "Not focusing the window because it is a "
 -                          "active client has focus\n");
++                          "transient, and its relatives aren't focused");
+         }
+         /* Don't steal focus from globally active clients.
+            I stole this idea from KWin. It seems nice.
+         */
+         else if (!(focus_client->can_focus ||
+                    focus_client->focus_notify))
+         {
+             steal = FALSE;
+             ob_debug_type(OB_DEBUG_FOCUS,
+                           "Not focusing the window because a globally "
 -                          "would get the focus anyway\n");
++                          "active client has focus");
+         }
+         /* Don't move focus if it's not going to go to this window
+            anyway */
+         else if (client_focus_target(self) != self) {
+             steal = FALSE;
+             ob_debug_type(OB_DEBUG_FOCUS,
+                           "Not focusing the window because another window "
 -                      "time %u (last user interaction time %u)\n",
++                          "would get the focus anyway");
+         }
+         /* Don't move focus if the window is not visible on the current
+            desktop and none of its relatives are focused */
+         else if (!(self->desktop == screen_desktop ||
+                    self->desktop == DESKTOP_ALL) &&
+                  !relative_focused)
+         {
+             steal = FALSE;
+             ob_debug_type(OB_DEBUG_FOCUS,
+                           "Not focusing the window because it is on "
+                           "another desktop and no relatives are focused ");
+         }
+     }
+     if (!steal)
+         ob_debug_type(OB_DEBUG_FOCUS,
+                       "Focus stealing prevention activated for %s at "
++                      "time %u (last user interaction time %u)",
+                       self->title, steal_time, event_last_user_time);
+     return steal;
+ }
  /*! Returns a new structure containing the per-app settings for this client.
    The returned structure needs to be freed with g_free. */
  static ObAppSettings *client_get_settings_state(ObClient *self)
@@@ -3759,9 -3872,8 +3759,7 @@@ gboolean client_focus(ObClient *self
         go moving on us */
      event_halt_focus_delay();
  
-     event_cancel_all_key_grabs();
 -    xerror_set_ignore(TRUE);
 -    xerror_occured = FALSE;
 +    obt_display_ignore_errors(TRUE);
  
      if (self->can_focus) {
          /* This can cause a BadMatch error with CurrentTime, or if an app
Simple merge
diff --cc openbox/event.c
index 38b6bec2ca3a413105ba919fc1c65eb2e080c5c2,e07d6a31217f14feaaf8c9edaa4f40344673ccad..4ddb7ac75c906b6a41c9b19c173c355916d84932
@@@ -1340,38 -1331,38 +1337,38 @@@ static void event_handle_client(ObClien
              } else
                  ob_debug_type(OB_DEBUG_APP_BUGS,
                                "_NET_ACTIVE_WINDOW message for window %s is "
 -                              "missing source indication\n", client->title);
 +                              "missing source indication", client->title);
-             client_activate(client, TRUE, TRUE, TRUE,
+             client_activate(client, FALSE, TRUE, TRUE,
                              (e->xclient.data.l[0] == 0 ||
                               e->xclient.data.l[0] == 2));
 -        } else if (msgtype == prop_atoms.net_wm_moveresize) {
 -            ob_debug("net_wm_moveresize for 0x%lx direction %d\n",
 +        } else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) {
 +            ob_debug("net_wm_moveresize for 0x%lx direction %d",
                       client->window, e->xclient.data.l[2]);
              if ((Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_topleft ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOPLEFT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_top ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOP) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_topright ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOPRIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_right ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_RIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_right ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_RIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_bottomright ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_bottom ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_BOTTOM) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_bottomleft ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_left ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_LEFT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_move ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_keyboard ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_KEYBOARD) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_move_keyboard) {
 -
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE_KEYBOARD))
 +            {
                  moveresize_start(client, e->xclient.data.l[0],
                                   e->xclient.data.l[1], e->xclient.data.l[3],
                                   e->xclient.data.l[2]);
diff --cc openbox/focus.c
index 2af0da9c0f892cbcdc0c17dde674e293ab81b9ab,8c3bd70a82e69bc89a6ef769736525abf10c3dc5..fc0fd99bac47c560ce05de3fe114b25d407b675a
@@@ -196,10 -193,8 +192,8 @@@ void focus_nothing(void
      /* nothing is focused, update the colormap and _the root property_ */
      focus_set_client(NULL);
  
-     event_cancel_all_key_grabs();
      /* when nothing will be focused, send focus to the backup target */
 -    XSetInputFocus(ob_display, screen_support_win, RevertToPointerRoot,
 +    XSetInputFocus(obt_display, screen_support_win, RevertToPointerRoot,
                     event_curtime);
  }
  
index d1a3f99bf3f0237d4d7c5f1306f1c9dabcc59df3,14018478ae183df6beda9a5af2015edaeec4ee2a..758e9887bb2ad3f2d8f5378ab3f0cda47dd57c96
@@@ -159,8 -156,13 +160,13 @@@ void session_shutdown(gboolean permanen
      }
  }
  
+ gboolean session_connected(void)
+ {
+     return !!sm_conn;
+ }
  /*! Connect to the session manager and set up our callback functions */
 -static gboolean session_connect()
 +static gboolean session_connect(void)
  {
      SmcCallbacks cb;
      gchar *oldid;
This page took 0.042763 seconds and 4 git commands to generate.