aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/openbox/openbox/fix-decorations.patch
blob: e3489b7ced55c08849e5fb364e44ee8143595be7 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Fix client decorations

Upstream-Status: Pending

diff --git a/openbox/client.c b/openbox/client.c
index c65e350..1c82763 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -1733,8 +1733,20 @@ void client_setup_decor_and_functions(ObClient *self, gboolean reconfig)
     switch (self->type) {
     case OB_CLIENT_TYPE_NORMAL:
         /* normal windows retain all of the possible decorations and
-           functionality, and can be fullscreen */
-        self->functions |= OB_CLIENT_FUNC_FULLSCREEN;
+           functionality, and can be fullscreen, unless if it can't be resized */
+        if (self->functions & OB_CLIENT_FUNC_RESIZE)
+            self->functions |= OB_CLIENT_FUNC_FULLSCREEN;
+        else {
+            self->decorations &= ~(OB_FRAME_DECOR_HANDLE |
+                                   OB_FRAME_DECOR_MAXIMIZE);
+
+            self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;
+
+            self->mwmhints.decorations &= ~(OB_MWM_DECOR_HANDLE |
+                                            OB_MWM_DECOR_MAXIMIZE);
+
+            self->mwmhints.functions &= ~OB_MWM_FUNC_MAXIMIZE;
+        }
         break;
 
     case OB_CLIENT_TYPE_DIALOG:
diff --git a/openbox/frame.c b/openbox/frame.c
index 64dd290..fc84f2f 100644
--- a/openbox/frame.c
+++ b/openbox/frame.c
@@ -1209,6 +1209,7 @@ static void layout_title(ObFrame *self)
             firstcon = &self->rightmost;
         }
 
+        self->decorations = self->client->decorations;
         /* stop at the end of the string (or the label, which calls break) */
         for (; *lc != '\0' && lc >= config_title_layout; lc+=i) {
             if (*lc == 'L') {
@@ -1217,23 +1218,23 @@ static void layout_title(ObFrame *self)
                     self->label_x = x;
                 }
                 break; /* break the for loop, do other side of label */
-            } else if (*lc == 'N') {
+            } else if (*lc == 'N' && (self->decorations & OB_FRAME_DECOR_ICON)) {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICON;
                 /* icon is bigger than buttons */
                 place_button(self, lc, bwidth + 2, left, i, &x, &self->icon_on, &self->icon_x);
-            } else if (*lc == 'D') {
+            } else if (*lc == 'D' && (self->decorations & OB_FRAME_DECOR_ALLDESKTOPS)) {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ALLDESKTOPS;
                 place_button(self, lc, bwidth, left, i, &x, &self->desk_on, &self->desk_x);
-            } else if (*lc == 'S') {
+            } else if (*lc == 'S' && (self->decorations & OB_FRAME_DECOR_SHADE)) {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_SHADE;
                 place_button(self, lc, bwidth, left, i, &x, &self->shade_on, &self->shade_x);
-            } else if (*lc == 'I') {
+            } else if (*lc == 'I' && (self->decorations & OB_FRAME_DECOR_ICONIFY)) {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICONIFY;
                 place_button(self, lc, bwidth, left, i, &x, &self->iconify_on, &self->iconify_x);
-            } else if (*lc == 'M') {
+            } else if (*lc == 'M' && (self->decorations & OB_FRAME_DECOR_MAXIMIZE)) {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_MAXIMIZE;
                 place_button(self, lc, bwidth, left, i, &x, &self->max_on, &self->max_x);
-            } else if (*lc == 'C') {
+            } else if (*lc == 'C' && (self->decorations & OB_FRAME_DECOR_CLOSE)) {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_CLOSE;
                 place_button(self, lc, bwidth, left, i, &x, &self->close_on, &self->close_x);
             } else