1 #include "ecore_xcb_private.h"
2 //#include "Ecore_X_Atoms.h"
4 #define ECORE_X_MWM_HINTS_FUNCTIONS (1 << 0)
5 #define ECORE_X_MWM_HINTS_DECORATIONS (1 << 1)
6 #define ECORE_X_MWM_HINTS_INPUT_MODE (1 << 2)
7 #define ECORE_X_MWM_HINTS_STATUS (1 << 3)
9 typedef struct _mwmhints
19 * @defgroup Ecore_X_MWM_Group MWM related functions.
21 * Functions related to MWM.
25 * Sets the borderless flag of a window using MWM.
27 * @param win The window.
28 * @param borderless The borderless flag.
30 * @ingroup Ecore_X_MWM_Group
33 ecore_x_mwm_borderless_set(Ecore_X_Window win,
36 uint32_t data[5] = { 0, 0, 0, 0, 0 };
38 LOGFN(__FILE__, __LINE__, __FUNCTION__);
41 data[2] = !borderless;
43 ecore_x_window_prop_property_set(win,
44 ECORE_X_ATOM_MOTIF_WM_HINTS,
45 ECORE_X_ATOM_MOTIF_WM_HINTS, 32,
50 ecore_x_mwm_hints_get(Ecore_X_Window win,
51 Ecore_X_MWM_Hint_Func *fhint,
52 Ecore_X_MWM_Hint_Decor *dhint,
53 Ecore_X_MWM_Hint_Input *ihint)
55 xcb_get_property_cookie_t cookie;
56 xcb_get_property_reply_t *reply;
57 MWMHints *mwmhints = NULL;
60 LOGFN(__FILE__, __LINE__, __FUNCTION__);
64 xcb_get_property_unchecked(_ecore_xcb_conn, 0, win,
65 ECORE_X_ATOM_MOTIF_WM_HINTS,
66 ECORE_X_ATOM_MOTIF_WM_HINTS, 0, UINT_MAX);
67 reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
68 if (!reply) return EINA_FALSE;
69 if ((reply->format != 32) || (reply->value_len == 0))
75 mwmhints = xcb_get_property_value(reply);
76 if (reply->value_len >= 4)
80 if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS)
81 *dhint = mwmhints->decorations;
83 *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
87 if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
88 *fhint = mwmhints->functions;
90 *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
94 if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
95 *ihint = mwmhints->inputmode;
97 *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;