all repos — openbox @ 5eba6007e78eb52da0a20e954fec9d88124c026d

openbox fork - make it a bit more like ryudo

change the "handle" context to "bottom". add a "top" context. make the top
and bottom contexts resize vertically in the default config file.
Dana Jansens danakj@orodu.net
commit

5eba6007e78eb52da0a20e954fec9d88124c026d

parent

06181f9cc4cfd689cff3f54e28548e7d91d1fbae

M data/rc.xmldata/rc.xml

@@ -256,12 +256,20 @@ <mousebind button="Right" action="Press">

<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">
M data/rc.xsddata/rc.xsd

@@ -388,12 +388,13 @@ <xsd:restriction base="xsd:string">

<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"/>
M openbox/config.copenbox/config.c

@@ -751,7 +751,7 @@ { "Left", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },

{ "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 @@ { "Left", "Shade", OB_MOUSE_ACTION_PRESS, "Focus" },

{ "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" },
M openbox/frame.copenbox/frame.c

@@ -139,6 +139,8 @@ attrib.event_mask = ELEMENT_EVENTMASK;

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 @@ self->width, ob_rr_theme->title_height);

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 @@ g_hash_table_insert(window_map, &self->iconify, self->client);

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 @@ g_hash_table_remove(window_map, &self->iconify);

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 @@ else if (!g_ascii_strcasecmp("Client", 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 @@ else if (!g_ascii_strcasecmp("BLCorner", 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 @@ }

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;
M openbox/frame.hopenbox/frame.h

@@ -34,12 +34,13 @@ OB_FRAME_CONTEXT_NONE,

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 @@ Window handle;

Window lgrip; Window rgrip; + Window topresize; Window tltresize; Window tllresize; Window trtresize;
M openbox/framerender.copenbox/framerender.c

@@ -177,8 +177,15 @@

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.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; - ob_rr_theme->a_clear->surface.parenty = 0; if (ob_rr_theme->grip_width > 0) RrPaint(ob_rr_theme->a_clear, self->tltresize,
M openbox/mouse.copenbox/mouse.c

@@ -65,16 +65,17 @@ case OB_FRAME_CONTEXT_NONE:

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: