2 * Various MWM related functions.
4 * This is ALL the code involving anything MWM related. for both WM and
10 #endif /* ifdef HAVE_CONFIG_H */
15 #include "ecore_x_private.h"
17 #include "Ecore_X_Atoms.h"
19 #define ECORE_X_MWM_HINTS_FUNCTIONS (1 << 0)
20 #define ECORE_X_MWM_HINTS_DECORATIONS (1 << 1)
21 #define ECORE_X_MWM_HINTS_INPUT_MODE (1 << 2)
22 #define ECORE_X_MWM_HINTS_STATUS (1 << 3)
24 typedef struct _mwmhints
35 ecore_x_mwm_hints_get(Ecore_X_Window win,
36 Ecore_X_MWM_Hint_Func *fhint,
37 Ecore_X_MWM_Hint_Decor *dhint,
38 Ecore_X_MWM_Hint_Input *ihint)
40 unsigned char *p = NULL;
41 MWMHints *mwmhints = NULL;
47 if (!ecore_x_window_prop_property_get(win,
48 ECORE_X_ATOM_MOTIF_WM_HINTS,
49 ECORE_X_ATOM_MOTIF_WM_HINTS,
56 mwmhints = (MWMHints *)p;
63 if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS)
64 *dhint = mwmhints->decorations;
66 *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
71 if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
72 *fhint = mwmhints->functions;
74 *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
79 if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
80 *ihint = mwmhints->inputmode;
82 *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;
95 ecore_x_mwm_borderless_set(Ecore_X_Window win,
98 unsigned int data[5] = {0, 0, 0, 0, 0};
100 data[0] = 2; /* just set the decorations hint! */
101 data[2] = !borderless;
104 ecore_x_window_prop_property_set(win,
105 ECORE_X_ATOM_MOTIF_WM_HINTS,
106 ECORE_X_ATOM_MOTIF_WM_HINTS,
107 32, (void *)data, 5);