</mousebind>
</context>
+ <context name="WindowMenu">
+ <mousebind button="Left" action="Click">
+ <action name="ShowMenu">
+ <menu>client-menu</menu>
+ </action>
+ </mousebind>
+ </context>
+
<context name="Iconify">
<mousebind button="left" action="Click">
<action name="Iconify"/>
LAB_SSD_BUTTON_CLOSE,
LAB_SSD_BUTTON_MAXIMIZE,
LAB_SSD_BUTTON_ICONIFY,
+ LAB_SSD_BUTTON_WINDOW_MENU,
LAB_SSD_PART_TITLEBAR,
LAB_SSD_PART_TITLE,
LAB_SSD_PART_CORNER_TOP_LEFT,
enum lab_justification window_label_text_justify;
/* button colors */
+ float window_active_button_menu_unpressed_image_color[4];
float window_active_button_iconify_unpressed_image_color[4];
float window_active_button_max_unpressed_image_color[4];
float window_active_button_close_unpressed_image_color[4];
+ float window_inactive_button_menu_unpressed_image_color[4];
float window_inactive_button_iconify_unpressed_image_color[4];
float window_inactive_button_max_unpressed_image_color[4];
float window_inactive_button_close_unpressed_image_color[4];
struct wlr_texture *xbm_close_active_unpressed;
struct wlr_texture *xbm_maximize_active_unpressed;
struct wlr_texture *xbm_iconify_active_unpressed;
+ struct wlr_texture *xbm_menu_active_unpressed;
struct wlr_texture *xbm_close_inactive_unpressed;
struct wlr_texture *xbm_maximize_inactive_unpressed;
struct wlr_texture *xbm_iconify_inactive_unpressed;
+ struct wlr_texture *xbm_menu_inactive_unpressed;
struct wlr_texture *corner_top_left_active_normal;
struct wlr_texture *corner_top_right_active_normal;
#include "common/zfree.h"
#include "labwc.h"
#include "menu/menu.h"
+#include "ssd.h"
#include "action.h"
enum action_type {
} else if (!strcasecmp(menu_name, "client-menu") && view) {
menu = server->windowmenu;
server->rootmenu->visible = false;
+ enum ssd_part_type type = ssd_at(view, server->seat.cursor->x,
+ server->seat.cursor->y);
+ if (type == LAB_SSD_BUTTON_WINDOW_MENU) {
+ force_menu_top_left = true;
+ } else if (ssd_part_contains(LAB_SSD_PART_TITLEBAR, type)) {
+ force_menu_top_left = false;
+ } else {
+ force_menu_top_left = true;
+ }
} else {
return;
}
return LAB_SSD_BUTTON_MAXIMIZE;
} else if (!strcasecmp(str, "Iconify")) {
return LAB_SSD_BUTTON_ICONIFY;
+ } else if (!strcasecmp(str, "WindowMenu")) {
+ return LAB_SSD_BUTTON_WINDOW_MENU;
} else if (!strcasecmp(str, "Titlebar")) {
return LAB_SSD_PART_TITLEBAR;
} else if (!strcasecmp(str, "Title")) {
{ "Close", "Left", "Click", "Close", NULL },
{ "Iconify", "Left", "Click", "Iconify", NULL},
{ "Maximize", "Left", "Click", "ToggleMaximize", NULL},
+ { "WindowMenu", "Left", "Click", "ShowMenu", "client-menu"},
{ "Root", "Left", "Press", "ShowMenu", "root-menu"},
{ "Root", "Right", "Press", "ShowMenu", "root-menu"},
{ "Root", "Middle", "Press", "ShowMenu", "root-menu"},
{
return type == LAB_SSD_BUTTON_CLOSE ||
type == LAB_SSD_BUTTON_MAXIMIZE ||
- type == LAB_SSD_BUTTON_ICONIFY;
+ type == LAB_SSD_BUTTON_ICONIFY ||
+ type == LAB_SSD_BUTTON_WINDOW_MENU;
}
static void
box = ssd_visible_box(view, LAB_SSD_BUTTON_ICONIFY);
render_icon(output, output_damage, &box,
theme->xbm_iconify_active_unpressed);
+ box = ssd_visible_box(view, LAB_SSD_BUTTON_WINDOW_MENU);
+ render_icon(output, output_damage, &box,
+ theme->xbm_menu_active_unpressed);
} else {
box = ssd_visible_box(view, LAB_SSD_BUTTON_CLOSE);
render_icon(output, output_damage, &box,
box = ssd_visible_box(view, LAB_SSD_BUTTON_ICONIFY);
render_icon(output, output_damage, &box,
theme->xbm_iconify_inactive_unpressed);
+ box = ssd_visible_box(view, LAB_SSD_BUTTON_WINDOW_MENU);
+ render_icon(output, output_damage, &box,
+ theme->xbm_menu_inactive_unpressed);
}
}
return box;
}
-#define NR_BUTTONS (3)
+#define NR_BUTTONS (4)
/**
* ssd_box - the 'full' decoration geometry which includes both visible
box.width = button_width;
box.height = button_height;
break;
+ case LAB_SSD_BUTTON_WINDOW_MENU:
+ box.x = view->x;
+ box.y = view->y - button_height;
+ box.width = button_width;
+ box.height = button_height;
+ break;
case LAB_SSD_PART_TITLEBAR:
box.x = view->x;
box.y = view->y - theme->title_height;
box.height = theme->title_height;
break;
case LAB_SSD_PART_TITLE:
- box.x = view->x + title_x_padding;
+ box.x = view->x + button_width + title_x_padding;
box.y = view->y - theme->title_height;
box.width = view->w - title_x_padding * 2 - NR_BUTTONS * button_width;
box.height = theme->title_height;
case LAB_SSD_BUTTON_ICONIFY:
box = ssd_box(view, type);
break;
+ case LAB_SSD_BUTTON_WINDOW_MENU:
+ box = ssd_box(view, type);
+ break;
case LAB_SSD_PART_TITLEBAR:
box = ssd_box(view, type);
box.x += theme->title_height;
parse_hexstr("#000000", theme->window_inactive_label_text_color);
theme->window_label_text_justify = parse_justification("Left");
+ parse_hexstr("#000000",
+ theme->window_active_button_menu_unpressed_image_color);
parse_hexstr("#000000",
theme->window_active_button_iconify_unpressed_image_color);
parse_hexstr("#000000",
theme->window_active_button_max_unpressed_image_color);
parse_hexstr("#000000",
theme->window_active_button_close_unpressed_image_color);
+ parse_hexstr("#000000",
+ theme->window_inactive_button_menu_unpressed_image_color);
parse_hexstr("#000000",
theme->window_inactive_button_iconify_unpressed_image_color);
parse_hexstr("#000000",
/* universal button */
if (match(key, "window.active.button.unpressed.image.color")) {
+ parse_hexstr(value,
+ theme->window_active_button_menu_unpressed_image_color);
parse_hexstr(value,
theme->window_active_button_iconify_unpressed_image_color);
parse_hexstr(value,
theme->window_active_button_close_unpressed_image_color);
}
if (match(key, "window.inactive.button.unpressed.image.color")) {
+ parse_hexstr(value,
+ theme->window_inactive_button_menu_unpressed_image_color);
parse_hexstr(value,
theme->window_inactive_button_iconify_unpressed_image_color);
parse_hexstr(value,
#include "xbm/xbm.h"
/* built-in 6x6 buttons */
-char close_button_normal[] = { 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 };
+char menu_button_normal[] = { 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00 };
char iconify_button_normal[] = { 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f };
char max_button_normal[] = { 0x3f, 0x3f, 0x21, 0x21, 0x21, 0x3f };
char max_button_toggled[] = { 0x3e, 0x22, 0x2f, 0x29, 0x39, 0x0f };
+char close_button_normal[] = { 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 };
static struct wlr_texture *
texture_from_pixmap(struct wlr_renderer *renderer, struct pixmap *pixmap)
void
xbm_load(struct theme *theme, struct wlr_renderer *r)
{
+ parse_set_color(theme->window_active_button_menu_unpressed_image_color);
+ load_button(r, "menu.xbm", &theme->xbm_menu_active_unpressed,
+ menu_button_normal);
parse_set_color(theme->window_active_button_iconify_unpressed_image_color);
load_button(r, "iconify.xbm", &theme->xbm_iconify_active_unpressed,
iconify_button_normal);
load_button(r, "close.xbm", &theme->xbm_close_active_unpressed,
close_button_normal);
+ parse_set_color(theme->window_inactive_button_menu_unpressed_image_color);
+ load_button(r, "menu.xbm", &theme->xbm_menu_inactive_unpressed,
+ menu_button_normal);
parse_set_color(theme->window_inactive_button_iconify_unpressed_image_color);
load_button(r, "iconify.xbm", &theme->xbm_iconify_inactive_unpressed,
iconify_button_normal);