[Xfce4-commits] r25695 - in xfwm4/trunk: mcs-plugin src themes/default.keys

Olivier Fourdan olivier at xfce.org
Wed May 9 21:51:35 CEST 2007


Author: olivier
Date: 2007-05-09 19:51:34 +0000 (Wed, 09 May 2007)
New Revision: 25695

Modified:
   xfwm4/trunk/mcs-plugin/xfwm4_shortcuteditor.c
   xfwm4/trunk/src/events.c
   xfwm4/trunk/src/screen.c
   xfwm4/trunk/src/settings.c
   xfwm4/trunk/src/settings.h
   xfwm4/trunk/themes/default.keys/keythemerc
Log:
Add shortcut for above state (Bug #629)

Modified: xfwm4/trunk/mcs-plugin/xfwm4_shortcuteditor.c
===================================================================
--- xfwm4/trunk/mcs-plugin/xfwm4_shortcuteditor.c	2007-05-09 18:32:40 UTC (rev 25694)
+++ xfwm4/trunk/mcs-plugin/xfwm4_shortcuteditor.c	2007-05-09 19:51:34 UTC (rev 25695)
@@ -1,20 +1,20 @@
 /*      $Id$
- 
+
         This program is free software; you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
         the Free Software Foundation; either version 2, or (at your option)
         any later version.
- 
+
         This program is distributed in the hope that it will be useful,
         but WITHOUT ANY WARRANTY; without even the implied warranty of
         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., 675 Mass Ave, Cambridge, MA 02139, USA.
- 
- 
+
+
         shortcut editor - Copyright (C) 2004 Jean-Francois Wauthy
  */
 
@@ -165,7 +165,7 @@
     {
         theme_file = g_build_filename (DATADIR, "themes", "Default", KEY_SUFFIX, KEYTHEMERC, NULL);
     }
-    
+
     while (TRUE)
     {
         gint response = GTK_RESPONSE_CANCEL;
@@ -314,7 +314,7 @@
 void
 loadtheme_in_treeview (ThemeInfo * ti, gpointer data)
 {
-    const gchar *shortcut_options_list[] = { 
+    const gchar *shortcut_options_list[] = {
         "close_window_key",
         "maximize_window_key",
         "maximize_vert_key",
@@ -334,6 +334,7 @@
         "move_resize_cancel_key",
         "raise_window_key",
         "lower_window_key",
+        "above_key",
         "fullscreen_key",
         "up_workspace_key",
         "down_workspace_key",
@@ -355,7 +356,7 @@
         NULL
     };
 
-    const gchar *shortcut_name_list[] = { 
+    const gchar *shortcut_name_list[] = {
         N_("Close window"),
         N_("Maximize window"),
         N_("Maximize window vertically"),
@@ -375,6 +376,7 @@
         N_("Cancel move/resize window"),
         N_("Raise window"),
         N_("Lower window"),
+        N_("Toggle above"),
         N_("Toggle fullscreen"),
         N_("Upper workspace"),
         N_("Bottom workspace"),
@@ -933,7 +935,7 @@
     /* Release keyboard if not yet done */
     gdk_keyboard_ungrab (GDK_CURRENT_TIME);
 
-    /* 
+    /*
        Tell it to the mcs manager, set the channel to raw mode
        so that the client gets notified even if the key theme
        name has not changed

Modified: xfwm4/trunk/src/events.c
===================================================================
--- xfwm4/trunk/src/events.c	2007-05-09 18:32:40 UTC (rev 25694)
+++ xfwm4/trunk/src/events.c	2007-05-09 19:51:34 UTC (rev 25695)
@@ -71,7 +71,7 @@
                                  PointerMotionMask | \
                                  ButtonPressMask | \
                                  ButtonReleaseMask)
-                  
+
 #define MODIFIER_MASK           (ShiftMask | \
                                  ControlMask | \
                                  AltMask | \
@@ -237,7 +237,7 @@
     passdata.ycurrent = passdata.y;
     passdata.clicks = 1;
     passdata.allow_double_click = allow_double_click;
-    passdata.timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, 
+    passdata.timeout = g_timeout_add_full (G_PRIORITY_DEFAULT,
                                            display_info->dbl_click_time,
                                            (GSourceFunc) typeOfClick_break,
                                            (gpointer) &passdata, NULL);
@@ -410,6 +410,9 @@
             case KEY_LOWER_WINDOW:
                 clientLower (c, None);
                 break;
+            case KEY_TOGGLE_ABOVE:
+                clientToggleAbove (c);
+                break;
             case KEY_TOGGLE_FULLSCREEN:
                 clientToggleFullscreen (c);
                 break;
@@ -450,13 +453,13 @@
                 }
                 break;
             case KEY_POPUP_MENU:
-                /* 
-                   We need to release the events here prior to grabbing 
+                /*
+                   We need to release the events here prior to grabbing
                    the keyboard in gtk menu otherwise we end with a dead lock...
                   */
                 XAllowEvents (display_info->dpy, AsyncKeyboard, CurrentTime);
-                show_window_menu (c, frameX (c) + frameLeft (c), 
-                                     frameY (c) + frameTop (c), 
+                show_window_menu (c, frameX (c) + frameLeft (c),
+                                     frameY (c) + frameTop (c),
                                      Button1, GDK_CURRENT_TIME);
 
                 /* 'nuff for now */
@@ -597,7 +600,7 @@
     }
 }
 
-static int 
+static int
 edgeGetPart (Client *c, XButtonEvent * ev)
 {
     int part, x_corner_pixels, y_corner_pixels, x_distance, y_distance;
@@ -1431,22 +1434,22 @@
             constrained = TRUE;
         }
 
-        /* 
-           Let's say that if the client performs a XRaiseWindow, we show the window if focus 
+        /*
+           Let's say that if the client performs a XRaiseWindow, we show the window if focus
            stealing prevention is not activated, otherwise we just set the "demands attention"
            flag...
          */
         if ((ev->value_mask & CWStackMode) && (wc.stack_mode == Above) && (wc.sibling == None))
         {
             Client *last_raised;
-            
+
             last_raised = clientGetLastRaise (screen_info);
             if (last_raised && (c != last_raised))
             {
                 if ((screen_info->params->prevent_focus_stealing) && (screen_info->params->activate_action == ACTIVATE_ACTION_NONE))
                 {
                     ev->value_mask &= ~(CWSibling | CWStackMode);
-                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
+                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
                     FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
                     clientSetNetState (c);
                 }
@@ -1509,7 +1512,7 @@
                 {
                     clientSetFocus (c->screen_info, c, ev->time, NO_FOCUS_FLAG);
                 }
-            } 
+            }
             else
             {
                 clientClearDelayedFocus ();
@@ -1697,10 +1700,10 @@
     }
 
     if ((ev->window == screen_info->xroot)
-        && ((ev->detail == NotifyDetailNone) 
+        && ((ev->detail == NotifyDetailNone)
             || ((ev->mode == NotifyNormal) && (ev->detail == NotifyInferior))))
     {
-        /* 
+        /*
            Handle unexpected focus transition to root (means that an unknown
            window has vanished and the focus is returned to the root).
          */
@@ -1727,10 +1730,10 @@
         clientUpdateFocus (screen_info, c, FOCUS_SORT);
         if ((user_focus != c) && (user_focus != NULL))
         {
-            /* 
+            /*
                Focus stealing prevention:
-               Some apps tend to focus the window directly. If focus stealing prevention is enabled, 
-               we revert the user set focus to the window that we think has focus and then set the 
+               Some apps tend to focus the window directly. If focus stealing prevention is enabled,
+               we revert the user set focus to the window that we think has focus and then set the
                demand attention flag.
 
                Note that focus stealing prevention is ignored between windows of the same group or
@@ -1742,12 +1745,12 @@
                 !clientSameGroup (c, user_focus) &&
                 !clientIsTransientOrModalFor (c, user_focus))
             {
-                TRACE ("Setting focus back to \"%s\" (0x%lx)", user_focus->name, user_focus->window); 
+                TRACE ("Setting focus back to \"%s\" (0x%lx)", user_focus->name, user_focus->window);
                 clientSetFocus (user_focus->screen_info, user_focus, getXServerTime (display_info), NO_FOCUS_FLAG);
 
                 if (current_focus)
                 {
-                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
+                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
                     FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
                     clientSetNetState (c);
                 }
@@ -1798,7 +1801,7 @@
                 "NotifyDetailNone" :
                 "(unknown)");
 
-    if ((ev->mode == NotifyGrab) || (ev->mode == NotifyUngrab) || 
+    if ((ev->mode == NotifyGrab) || (ev->mode == NotifyUngrab) ||
         (ev->detail == NotifyInferior) || (ev->detail > NotifyNonlinearVirtual))
     {
         /* We're not interested in such notifications */
@@ -1894,19 +1897,19 @@
             if (clientCheckTransientWindow (c, w))
             {
                 c->transient_for = w;
-#if 0                
+#if 0
                 /*
                   Java 1.6 updates the WM_TRANSIENT_FOR properties "on-the-fly"
-                  of its windows to maintain the z-order. 
-                  
-                  If we raise the transient then, we clearly have a race 
-                  condition between the WM and Java... And that breaks 
+                  of its windows to maintain the z-order.
+
+                  If we raise the transient then, we clearly have a race
+                  condition between the WM and Java... And that breaks
                   the z-order. Bug #2483.
-                  
+
                   I still think that raising here makes sense, to ensure
                   that the newly promoted transient window is placed above
                   its parent.
-                  
+
                   Chances are that Java 1.6 won't change any time soon (heh,
                   it's not even released yet), so let's adjust the WM to
                   work with Java 1.6...
@@ -2133,7 +2136,7 @@
                 TRACE ("Time of event received is %u, current XServer time is %u", (unsigned int) ev_time, (unsigned int) current);
                 if ((screen_info->params->prevent_focus_stealing) && TIMESTAMP_IS_BEFORE(ev_time, current))
                 {
-                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
+                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
                     FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
                     clientSetNetState (c);
                 }
@@ -2168,10 +2171,10 @@
              (ev->message_type == display_info->atoms[NET_CURRENT_DESKTOP])) && (ev->format == 32))
         {
             TRACE ("root has received a win_workspace or a NET_CURRENT_DESKTOP event %li", ev->data.l[0]);
-            if ((ev->data.l[0] >= 0) && (ev->data.l[0] < screen_info->workspace_count) && 
+            if ((ev->data.l[0] >= 0) && (ev->data.l[0] < screen_info->workspace_count) &&
                 (ev->data.l[0] != screen_info->current_ws))
             {
-                workspaceSwitch (screen_info, ev->data.l[0], NULL, TRUE, 
+                workspaceSwitch (screen_info, ev->data.l[0], NULL, TRUE,
                                  myDisplayGetTime (display_info, (Time) ev->data.l[1]));
             }
         }
@@ -2205,10 +2208,10 @@
         else if ((ev->message_type == display_info->atoms[MANAGER]) && (ev->format == 32))
         {
             Atom selection;
-            
+
             TRACE ("window (0x%lx) has received a MANAGER event", ev->window);
             selection = (Atom) ev->data.l[1];
-            
+
 #ifdef ENABLE_KDE_SYSTRAY_PROXY
             if (selection == screen_info->net_system_tray_selection)
             {

Modified: xfwm4/trunk/src/screen.c
===================================================================
--- xfwm4/trunk/src/screen.c	2007-05-09 18:32:40 UTC (rev 25694)
+++ xfwm4/trunk/src/screen.c	2007-05-09 19:51:34 UTC (rev 25695)
@@ -459,6 +459,7 @@
     grabKey (dpy, &screen_info->params->keys[KEY_SHADE_WINDOW], screen_info->xroot);
     grabKey (dpy, &screen_info->params->keys[KEY_SHOW_DESKTOP], screen_info->xroot);
     grabKey (dpy, &screen_info->params->keys[KEY_STICK_WINDOW], screen_info->xroot);
+    grabKey (dpy, &screen_info->params->keys[KEY_TOGGLE_ABOVE], screen_info->xroot);
     grabKey (dpy, &screen_info->params->keys[KEY_TOGGLE_FULLSCREEN], screen_info->xroot);
     grabKey (dpy, &screen_info->params->keys[KEY_UP_WORKSPACE], screen_info->xroot);
     grabKey (dpy, &screen_info->params->keys[KEY_WORKSPACE_1], screen_info->xroot);

Modified: xfwm4/trunk/src/settings.c
===================================================================
--- xfwm4/trunk/src/settings.c	2007-05-09 18:32:40 UTC (rev 25694)
+++ xfwm4/trunk/src/settings.c	2007-05-09 19:51:34 UTC (rev 25695)
@@ -1318,6 +1318,7 @@
     parseKeyString (dpy, &screen_info->params->keys[KEY_SHADE_WINDOW], getValue ("shade_window_key", rc));
     parseKeyString (dpy, &screen_info->params->keys[KEY_SHOW_DESKTOP], getValue("show_desktop_key", rc));
     parseKeyString (dpy, &screen_info->params->keys[KEY_STICK_WINDOW], getValue ("stick_window_key", rc));
+    parseKeyString (dpy, &screen_info->params->keys[KEY_TOGGLE_ABOVE], getValue ("above_key", rc));
     parseKeyString (dpy, &screen_info->params->keys[KEY_TOGGLE_FULLSCREEN], getValue ("fullscreen_key", rc));
     parseKeyString (dpy, &screen_info->params->keys[KEY_UP_WORKSPACE], getValue ("up_workspace_key", rc));
     parseKeyString (dpy, &screen_info->params->keys[KEY_WORKSPACE_1], getValue ("workspace_1_key", rc));
@@ -1436,6 +1437,7 @@
         {"wrap_windows", NULL, TRUE},
         {"wrap_workspaces", NULL, TRUE},
         /* Keys */
+        {"above_key", NULL, TRUE},
         {"add_workspace_key", NULL, TRUE},
         {"cancel_key", NULL, TRUE},
         {"close_window_key", NULL, TRUE},
@@ -1578,7 +1580,7 @@
     set_settings_margin (screen_info, STRUTS_TOP,    TOINT (getValue ("margin_top", rc)));
 
     set_easy_click (screen_info, getValue ("easy_click", rc));
-    
+
     value = getValue ("placement_mode", rc);
     set_placement_mode (screen_info, value);
 

Modified: xfwm4/trunk/src/settings.h
===================================================================
--- xfwm4/trunk/src/settings.h	2007-05-09 18:32:40 UTC (rev 25694)
+++ xfwm4/trunk/src/settings.h	2007-05-09 19:51:34 UTC (rev 25695)
@@ -120,6 +120,7 @@
     KEY_SHADE_WINDOW,
     KEY_SHOW_DESKTOP,
     KEY_STICK_WINDOW,
+    KEY_TOGGLE_ABOVE,
     KEY_TOGGLE_FULLSCREEN,
     KEY_UP_WORKSPACE,
     KEY_WORKSPACE_1,

Modified: xfwm4/trunk/themes/default.keys/keythemerc
===================================================================
--- xfwm4/trunk/themes/default.keys/keythemerc	2007-05-09 18:32:40 UTC (rev 25694)
+++ xfwm4/trunk/themes/default.keys/keythemerc	2007-05-09 19:51:34 UTC (rev 25695)
@@ -1,3 +1,4 @@
+above_key=Alt+F12
 add_workspace_key=Alt+Insert
 cancel_key=Escape
 close_window_key=Alt+F4



More information about the Xfce4-commits mailing list