blob: 058130d857500ca188be2cc8de48d07435c9de3c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
--- a/plugins/decor/deco-layout.hpp
+++ b/plugins/decor/deco-layout.hpp
@@ -82,6 +82,7 @@
DECORATION_ACTION_MINIMIZE = 5,
DECORATION_ACTION_TOGGLE_MAXIMIZE_VERTICAL = 6,
DECORATION_ACTION_TOGGLE_MAXIMIZE_HORIZONTAL = 7,
+ DECORATION_ACTION_SHOW_MENU = 8,
};
class decoration_theme_t;
--- a/plugins/decor/deco-layout.cpp
+++ b/plugins/decor/deco-layout.cpp
@@ -248,6 +248,11 @@
if (pressed)
{
auto area = find_area_at(current_input);
+ if (area && (area->get_type() == DECORATION_AREA_TITLE) && (button == BTN_RIGHT))
+ {
+ return {DECORATION_ACTION_SHOW_MENU, 0};
+ }
+
if (area && (area->get_type() & DECORATION_AREA_MOVE_BIT))
{
if (timer.is_connected())
--- a/plugins/decor/deco-subsurface.cpp
+++ b/plugins/decor/deco-subsurface.cpp
@@ -294,6 +294,15 @@
return wf::get_core().default_wm->minimize_request(view, true);
break;
+ case wf::decor::DECORATION_ACTION_SHOW_MENU:
+ {
+ wf::view_show_window_menu_signal signal;
+ signal.view = view;
+ signal.relative_position = {0, 0};
+ wf::get_core().emit(&signal);
+ return;
+ }
+
default:
break;
}
|