]> Dogcows Code - chaz/openbox/commitdiff
change the "handle" context to "bottom". add a "top" context. make the top
authorDana Jansens <danakj@orodu.net>
Sat, 12 May 2007 17:54:55 +0000 (17:54 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 12 May 2007 17:54:55 +0000 (17:54 +0000)
and bottom contexts resize vertically in the default config file.

data/rc.xml
data/rc.xsd
openbox/config.c
openbox/frame.c
openbox/frame.h
openbox/framerender.c
openbox/mouse.c

index bda1ca88b0cb3af96021c02484c9de9a56367079..515acffaf173f9a45db6461d970a53545dbf4564 100644 (file)
       <action name="ShowMenu"><menu>client-menu</menu></action>
     </mousebind>
   </context>
-  <context name="Handle">
+  <context name="Top">
+    <mousebind button="Left" action="Drag">
+      <action name="Resize"><edge>top</edge></action>
+    </mousebind>
+    <mousebind button="Left" action="Press">
+      <action name="Activate"/>
+    </mousebind>
+  </context>
+  <context name="Bottom">
     <mousebind button="Left" action="Drag">
       <action name="Resize"><edge>bottom</edge></action>
     </mousebind>
     <mousebind button="Left" action="Press">
-      <action name="Focus"/>
+      <action name="Activate"/>
     </mousebind>
   </context>
   <context name="BLCorner">
index af4eda4ab9279b7487728eb8e67e2167d14595c3..a4397258d442a12e17dac42e9f26259d8553e755 100644 (file)
             <xsd:enumeration value="Desktop"/>
             <xsd:enumeration value="Client"/>
             <xsd:enumeration value="Titlebar"/>
-            <xsd:enumeration value="Handle"/>
             <xsd:enumeration value="Frame"/>
             <xsd:enumeration value="TLCorner"/>
             <xsd:enumeration value="TRCorner"/>
             <xsd:enumeration value="BLCorner"/>
             <xsd:enumeration value="BRCorner"/>
+            <xsd:enumeration value="Top"/>
+            <xsd:enumeration value="Bottom"/>
             <xsd:enumeration value="Maximize"/>
             <xsd:enumeration value="AllDesktops"/>
             <xsd:enumeration value="Shade"/>
index 99e35b5ada0d57e92ba2e7d1a3e3cb6fd71dcd50..c4fed63d194ae566c5e9e5d899abbe74fd8364f5 100644 (file)
@@ -751,7 +751,7 @@ static void bind_default_mouse()
         { "Middle", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
         { "Right", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
         { "Left", "Titlebar", OB_MOUSE_ACTION_PRESS, "Focus" },
-        { "Left", "Handle", OB_MOUSE_ACTION_PRESS, "Focus" },
+        { "Left", "Bottom", OB_MOUSE_ACTION_PRESS, "Focus" },
         { "Left", "BLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
         { "Left", "BRCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
         { "Left", "TLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
@@ -765,7 +765,6 @@ static void bind_default_mouse()
         { "Left", "Client", OB_MOUSE_ACTION_CLICK, "Raise" },
         { "Left", "Titlebar", OB_MOUSE_ACTION_CLICK, "Raise" },
         { "Middle", "Titlebar", OB_MOUSE_ACTION_CLICK, "Lower" },
-        { "Left", "Handle", OB_MOUSE_ACTION_CLICK, "Raise" },
         { "Left", "BLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
         { "Left", "BRCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
         { "Left", "TLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
index 716d23ada421fc82b0b8e64bad19ee07d9bfe856..3b01710b563109ff6ff1c726459899ec3dae172d 100644 (file)
@@ -139,6 +139,8 @@ ObFrame *frame_new(ObClient *client)
     self->title = createWindow(self->window, NULL, mask, &attrib);
 
     mask |= CWCursor;
+    attrib.cursor = ob_cursor(OB_CURSOR_NORTH);
+    self->topresize = createWindow(self->title, NULL, mask, &attrib);
     attrib.cursor = ob_cursor(OB_CURSOR_NORTHWEST);
     self->tltresize = createWindow(self->title, NULL, mask, &attrib);
     self->tllresize = createWindow(self->title, NULL, mask, &attrib);
@@ -379,17 +381,27 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
                 XMapWindow(ob_display, self->title);
 
                 if (self->decorations & OB_FRAME_DECOR_GRIPS) {
+                    XMoveResizeWindow(ob_display, self->topresize,
+                                      ob_rr_theme->grip_width + self->bwidth,
+                                      0,
+                                      self->width - (ob_rr_theme->grip_width +
+                                                     self->bwidth) * 2,
+                                      ob_rr_theme->paddingy + 1);
+
                     XMoveWindow(ob_display, self->tltresize, 0, 0);
                     XMoveWindow(ob_display, self->tllresize, 0, 0);
                     XMoveWindow(ob_display, self->trtresize,
                                 self->width - ob_rr_theme->grip_width, 0);
                     XMoveWindow(ob_display, self->trrresize,
                                 self->width - ob_rr_theme->paddingx - 1, 0);
+
+                    XMapWindow(ob_display, self->topresize);
                     XMapWindow(ob_display, self->tltresize);
                     XMapWindow(ob_display, self->tllresize);
                     XMapWindow(ob_display, self->trtresize);
                     XMapWindow(ob_display, self->trrresize);
                 } else {
+                    XUnmapWindow(ob_display, self->topresize);
                     XUnmapWindow(ob_display, self->tltresize);
                     XUnmapWindow(ob_display, self->tllresize);
                     XUnmapWindow(ob_display, self->trtresize);
@@ -579,6 +591,7 @@ void frame_grab_client(ObFrame *self)
     g_hash_table_insert(window_map, &self->handle, self->client);
     g_hash_table_insert(window_map, &self->lgrip, self->client);
     g_hash_table_insert(window_map, &self->rgrip, self->client);
+    g_hash_table_insert(window_map, &self->topresize, self->client);
     g_hash_table_insert(window_map, &self->tltresize, self->client);
     g_hash_table_insert(window_map, &self->tllresize, self->client);
     g_hash_table_insert(window_map, &self->trtresize, self->client);
@@ -636,6 +649,7 @@ void frame_release_client(ObFrame *self)
     g_hash_table_remove(window_map, &self->handle);
     g_hash_table_remove(window_map, &self->lgrip);
     g_hash_table_remove(window_map, &self->rgrip);
+    g_hash_table_remove(window_map, &self->topresize);
     g_hash_table_remove(window_map, &self->tltresize);
     g_hash_table_remove(window_map, &self->tllresize);
     g_hash_table_remove(window_map, &self->trtresize);
@@ -819,8 +833,6 @@ ObFrameContext frame_context_from_string(const gchar *name)
         return OB_FRAME_CONTEXT_CLIENT;
     else if (!g_ascii_strcasecmp("Titlebar", name))
         return OB_FRAME_CONTEXT_TITLEBAR;
-    else if (!g_ascii_strcasecmp("Handle", name))
-        return OB_FRAME_CONTEXT_HANDLE;
     else if (!g_ascii_strcasecmp("Frame", name))
         return OB_FRAME_CONTEXT_FRAME;
     else if (!g_ascii_strcasecmp("TLCorner", name))
@@ -831,6 +843,10 @@ ObFrameContext frame_context_from_string(const gchar *name)
         return OB_FRAME_CONTEXT_BLCORNER;
     else if (!g_ascii_strcasecmp("BRCorner", name))
         return OB_FRAME_CONTEXT_BRCORNER;
+    else if (!g_ascii_strcasecmp("Top", name))
+        return OB_FRAME_CONTEXT_TOP;
+    else if (!g_ascii_strcasecmp("Bottom", name))
+        return OB_FRAME_CONTEXT_BOTTOM;
     else if (!g_ascii_strcasecmp("Maximize", name))
         return OB_FRAME_CONTEXT_MAXIMIZE;
     else if (!g_ascii_strcasecmp("AllDesktops", name))
@@ -900,9 +916,10 @@ ObFrameContext frame_context(ObClient *client, Window win, gint x, gint y)
 
     if (win == self->window)    return OB_FRAME_CONTEXT_FRAME;
     if (win == self->label)     return OB_FRAME_CONTEXT_TITLEBAR;
-    if (win == self->handle)    return OB_FRAME_CONTEXT_HANDLE;
+    if (win == self->handle)    return OB_FRAME_CONTEXT_BOTTOM;
     if (win == self->lgrip)     return OB_FRAME_CONTEXT_BLCORNER;
     if (win == self->rgrip)     return OB_FRAME_CONTEXT_BRCORNER;
+    if (win == self->topresize) return OB_FRAME_CONTEXT_TOP;
     if (win == self->tltresize) return OB_FRAME_CONTEXT_TLCORNER;
     if (win == self->tllresize) return OB_FRAME_CONTEXT_TLCORNER;
     if (win == self->trtresize) return OB_FRAME_CONTEXT_TRCORNER;
index ebd8de982457afb76cf27b2f846ae9a4c450eae2..0f5634323acc9f21dcee72573104d7681cadb1b4 100644 (file)
@@ -34,12 +34,13 @@ typedef enum {
     OB_FRAME_CONTEXT_DESKTOP,
     OB_FRAME_CONTEXT_CLIENT,
     OB_FRAME_CONTEXT_TITLEBAR,
-    OB_FRAME_CONTEXT_HANDLE,
     OB_FRAME_CONTEXT_FRAME,
     OB_FRAME_CONTEXT_BLCORNER,
     OB_FRAME_CONTEXT_BRCORNER,
     OB_FRAME_CONTEXT_TLCORNER,
     OB_FRAME_CONTEXT_TRCORNER,
+    OB_FRAME_CONTEXT_TOP,
+    OB_FRAME_CONTEXT_BOTTOM,
     OB_FRAME_CONTEXT_MAXIMIZE,
     OB_FRAME_CONTEXT_ALLDESKTOPS,
     OB_FRAME_CONTEXT_SHADE,
@@ -95,6 +96,7 @@ struct _ObFrame
     Window    lgrip;
     Window    rgrip;
 
+    Window    topresize;
     Window    tltresize;
     Window    tllresize;
     Window    trtresize;
index 97d5ef53ea4e55c7035fc9cafcf31e28c0c98ec3..82a98a8e5659c0824ca85132c2f1d438e5a6d7d3 100644 (file)
@@ -177,9 +177,16 @@ void framerender_frame(ObFrame *self)
         RrPaint(t, self->title, self->width, ob_rr_theme->title_height);
 
         ob_rr_theme->a_clear->surface.parent = t;
-        ob_rr_theme->a_clear->surface.parentx = 0;
         ob_rr_theme->a_clear->surface.parenty = 0;
 
+        ob_rr_theme->a_clear->surface.parentx = ob_rr_theme->grip_width +
+            self->bwidth;
+        RrPaint(ob_rr_theme->a_clear, self->topresize,
+                self->width - (ob_rr_theme->grip_width + self->bwidth) * 2,
+                ob_rr_theme->paddingy + 1);
+
+        ob_rr_theme->a_clear->surface.parentx = 0;
+
         if (ob_rr_theme->grip_width > 0)
             RrPaint(ob_rr_theme->a_clear, self->tltresize,
                     ob_rr_theme->grip_width, ob_rr_theme->paddingy + 1);
index 9ca7987728fa43044893dc105d488559275fb71c..8b0cfccbd0a0b887e2de95ff2a7d4e449958f92c 100644 (file)
@@ -65,16 +65,17 @@ ObFrameContext mouse_button_frame_context(ObFrameContext context,
     case OB_FRAME_CONTEXT_DESKTOP:
     case OB_FRAME_CONTEXT_CLIENT:
     case OB_FRAME_CONTEXT_TITLEBAR:
-    case OB_FRAME_CONTEXT_HANDLE:
     case OB_FRAME_CONTEXT_FRAME:
     case OB_FRAME_CONTEXT_MOVE_RESIZE:
         break;
+    case OB_FRAME_CONTEXT_BOTTOM:
     case OB_FRAME_CONTEXT_BLCORNER:
     case OB_FRAME_CONTEXT_BRCORNER:
-        x = OB_FRAME_CONTEXT_HANDLE;
+        x = OB_FRAME_CONTEXT_BOTTOM;
         break;
     case OB_FRAME_CONTEXT_TLCORNER:
     case OB_FRAME_CONTEXT_TRCORNER:
+    case OB_FRAME_CONTEXT_TOP:
     case OB_FRAME_CONTEXT_MAXIMIZE:
     case OB_FRAME_CONTEXT_ALLDESKTOPS:
     case OB_FRAME_CONTEXT_SHADE:
This page took 0.033797 seconds and 4 git commands to generate.