summaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorDima Ryazanov <dima@gmail.com>2015-05-03 19:56:37 -0700
committerBryce Harrington <bryce@osg.samsung.com>2015-05-14 20:32:02 -0700
commitb0f5a25d16c18927fb9853c667132de63483dd54 (patch)
treedea4fd957c703b43fb7385f0d69aefbf7820d0f8 /xwayland
parent0c944b07c451212bd287e79985a99333b8d4c368 (diff)
downloadweston-b0f5a25d16c18927fb9853c667132de63483dd54.tar.gz
xwm: Fix the window decoration hints.
Enable all hints by default. This fixes the "Maximize" button in apps that don't set any hints - e.g., xclock or Firefox. (There's still a problem, though: "decorate" is sometimes treated as a boolean, sometimes as a bitmask.) Handle MWM_DECOR_ALL correctly. It looks like it's supposed to invert the values of the rest of the flags. Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/window-manager.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 039f0cd0..1ea2c4c1 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -94,6 +94,10 @@ struct motif_wm_hints {
#define MWM_DECOR_MINIMIZE (1L << 5)
#define MWM_DECOR_MAXIMIZE (1L << 6)
+#define MWM_DECOR_EVERYTHING \
+ (MWM_DECOR_BORDER | MWM_DECOR_RESIZEH | MWM_DECOR_TITLE | \
+ MWM_DECOR_MENU | MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE)
+
#define MWM_INPUT_MODELESS 0
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
#define MWM_INPUT_SYSTEM_MODAL 2
@@ -425,7 +429,7 @@ weston_wm_window_read_properties(struct weston_wm_window *window)
props[i].atom,
XCB_ATOM_ANY, 0, 2048);
- window->decorate = !window->override_redirect;
+ window->decorate = window->override_redirect ? 0 : MWM_DECOR_EVERYTHING;
window->size_hints.flags = 0;
window->motif_hints.flags = 0;
window->delete_window = 0;
@@ -495,9 +499,15 @@ weston_wm_window_read_properties(struct weston_wm_window *window)
memcpy(&window->motif_hints,
xcb_get_property_value(reply),
sizeof window->motif_hints);
- if (window->motif_hints.flags & MWM_HINTS_DECORATIONS)
- window->decorate =
- window->motif_hints.decorations;
+ if (window->motif_hints.flags & MWM_HINTS_DECORATIONS) {
+ if (window->motif_hints.decorations & MWM_DECOR_ALL)
+ /* MWM_DECOR_ALL means all except the other values listed. */
+ window->decorate =
+ MWM_DECOR_EVERYTHING & (~window->motif_hints.decorations);
+ else
+ window->decorate =
+ window->motif_hints.decorations;
+ }
break;
default:
break;