change the "handle" context to "bottom". add a "top" context. make the top
and bottom contexts resize vertically in the default config file.
This commit is contained in:
parent
06181f9cc4
commit
5eba6007e7
7 changed files with 47 additions and 12 deletions
12
data/rc.xml
12
data/rc.xml
|
@ -256,12 +256,20 @@
|
|||
<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">
|
||||
|
|
|
@ -388,12 +388,13 @@
|
|||
<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"/>
|
||||
|
|
|
@ -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" },
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue