diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 920455b9..ea2a6efb 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -186,8 +186,10 @@ The rest of this man page describes configuration options. ** can exist within one ** Define a mouse binding. Supported context-names include: - - TitleBar: The area where the title of the window is shown. - - Title: The title of the window itself. + - TitleBar: The decoration on top of the window, where the window + buttons and the window title are shown. + - Title: The area of the titlebar (including blank space) between + the window buttons, where the window title is displayed. - WindowMenu: The button on the left. - Iconify: The button that looks like an underline. - Maximize: The button that looks like a box. diff --git a/docs/rc.xml.all b/docs/rc.xml.all index 390599f8..457038dc 100644 --- a/docs/rc.xml.all +++ b/docs/rc.xml.all @@ -215,9 +215,6 @@ - - - @@ -225,9 +222,13 @@ client-menu + + + + + + - - diff --git a/src/config/rcxml.c b/src/config/rcxml.c index c0a92991..141b2c3d 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -570,8 +570,8 @@ static struct mouse_combos { { "Frame", "A-Right", "Drag", "Resize", NULL}, { "Titlebar", "Left", "Press", "Focus", NULL}, { "Titlebar", "Left", "Press", "Raise", NULL}, - { "TitleBar", "Left", "Drag", "Move", NULL }, - { "TitleBar", "Left", "DoubleClick", "ToggleMaximize", NULL }, + { "Title", "Left", "Drag", "Move", NULL }, + { "Title", "Left", "DoubleClick", "ToggleMaximize", NULL }, { "TitleBar", "Right", "Click", "Focus", NULL}, { "TitleBar", "Right", "Click", "Raise", NULL}, { "TitleBar", "Right", "Click", "ShowMenu", "client-menu"}, diff --git a/src/interactive.c b/src/interactive.c index d0d8f808..be469f7b 100644 --- a/src/interactive.c +++ b/src/interactive.c @@ -31,6 +31,26 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges) /* We don't allow resizing while in maximized or fullscreen state */ return; } + + /* + * This function sets up an interactive move or resize operation, where + * the compositor stops propagating pointer events to clients and + * instead consumes them itself, to move or resize windows. + */ + struct seat *seat = &view->server->seat; + struct server *server = view->server; + server->grabbed_view = view; + server->input_mode = mode; + + /* Remember view and cursor positions at start of move/resize */ + server->grab_x = seat->cursor->x; + server->grab_y = seat->cursor->y; + server->grab_box.x = view->x; + server->grab_box.y = view->y; + server->grab_box.width = view->w; + server->grab_box.height = view->h; + server->resize_edges = edges; + if (view->maximized || view->tiled) { if (mode == LAB_INPUT_STATE_MOVE) { /* Exit maximized or tiled mode */ @@ -52,35 +72,16 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges) * the current values in server->grab_box. We pretend the * configure already happened by setting them manually. */ - view->x = new_x; - view->y = new_y; - view->w = view->natural_geometry.width; - view->h = view->natural_geometry.height; + server->grab_box.x = new_x; + server->grab_box.y = new_y; + server->grab_box.width = view->natural_geometry.width; + server->grab_box.height = view->natural_geometry.height; } } /* Moving or resizing always resets tiled state */ view->tiled = 0; - /* - * This function sets up an interactive move or resize operation, where - * the compositor stops propagating pointer events to clients and - * instead consumes them itself, to move or resize windows. - */ - struct seat *seat = &view->server->seat; - struct server *server = view->server; - server->grabbed_view = view; - server->input_mode = mode; - - /* Remember view and cursor positions at start of move/resize */ - server->grab_x = seat->cursor->x; - server->grab_y = seat->cursor->y; - struct wlr_box box = { - .x = view->x, .y = view->y, .width = view->w, .height = view->h - }; - memcpy(&server->grab_box, &box, sizeof(struct wlr_box)); - server->resize_edges = edges; - switch (mode) { case LAB_INPUT_STATE_MOVE: cursor_set(&server->seat, "grab"); diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c index e6362f34..14e7f462 100644 --- a/src/ssd/ssd.c +++ b/src/ssd/ssd.c @@ -68,12 +68,16 @@ ssd_get_part_type(struct view *view, struct wlr_scene_node *node) struct wl_list *part_list = NULL; struct wlr_scene_tree *grandparent = node->parent ? node->parent->node.parent : NULL; + struct wlr_scene_tree *greatgrandparent = + grandparent ? grandparent->node.parent : NULL; /* active titlebar */ if (node->parent == view->ssd.titlebar.active.tree) { part_list = &view->ssd.titlebar.active.parts; } else if (grandparent == view->ssd.titlebar.active.tree) { part_list = &view->ssd.titlebar.active.parts; + } else if (greatgrandparent == view->ssd.titlebar.active.tree) { + part_list = &view->ssd.titlebar.active.parts; /* extents */ } else if (node->parent == view->ssd.extents.tree) { @@ -88,6 +92,8 @@ ssd_get_part_type(struct view *view, struct wlr_scene_node *node) part_list = &view->ssd.titlebar.inactive.parts; } else if (grandparent == view->ssd.titlebar.inactive.tree) { part_list = &view->ssd.titlebar.inactive.parts; + } else if (greatgrandparent == view->ssd.titlebar.inactive.tree) { + part_list = &view->ssd.titlebar.inactive.parts; /* inactive border */ } else if (node->parent == view->ssd.border.inactive.tree) { @@ -243,6 +249,11 @@ ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate) return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_PART_TITLE; } + if (whole == LAB_SSD_PART_TITLE) { + /* "Title" includes blank areas of "Titlebar" as well */ + return candidate >= LAB_SSD_PART_TITLEBAR + && candidate <= LAB_SSD_PART_TITLE; + } if (whole == LAB_SSD_FRAME) { return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_CLIENT;