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.
20 * @ingroup Ecore_X_Group
22 * Functions related to MWM.
26 * Sets the borderless flag of a window using MWM.
28 * @param win The window.
29 * @param borderless The borderless flag.
31 * @ingroup Ecore_X_MWM_Group
34 ecore_x_mwm_borderless_set(Ecore_X_Window win,
37 uint32_t data[5] = { 0, 0, 0, 0, 0 };
39 LOGFN(__FILE__, __LINE__, __FUNCTION__);
42 data[2] = !borderless;
44 ecore_x_window_prop_property_set(win,
45 ECORE_X_ATOM_MOTIF_WM_HINTS,
46 ECORE_X_ATOM_MOTIF_WM_HINTS, 32,
51 ecore_x_mwm_hints_get(Ecore_X_Window win,
52 Ecore_X_MWM_Hint_Func *fhint,
53 Ecore_X_MWM_Hint_Decor *dhint,
54 Ecore_X_MWM_Hint_Input *ihint)
56 xcb_get_property_cookie_t cookie;
57 xcb_get_property_reply_t *reply;
58 MWMHints *mwmhints = NULL;
61 LOGFN(__FILE__, __LINE__, __FUNCTION__);
65 xcb_get_property_unchecked(_ecore_xcb_conn, 0, win,
66 ECORE_X_ATOM_MOTIF_WM_HINTS,
67 ECORE_X_ATOM_MOTIF_WM_HINTS, 0, UINT_MAX);
68 reply = xcb_get_property_reply(_ecore_xcb_conn, cookie, NULL);
69 if (!reply) return EINA_FALSE;
70 if ((reply->format != 32) || (reply->value_len == 0))
76 mwmhints = xcb_get_property_value(reply);
77 if (reply->value_len >= 4)
81 if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS)
82 *dhint = mwmhints->decorations;
84 *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
88 if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
89 *fhint = mwmhints->functions;
91 *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
95 if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
96 *ihint = mwmhints->inputmode;
98 *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;