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;
45 LOGFN(__FILE__, __LINE__, __FUNCTION__);
47 if (!ecore_x_window_prop_property_get(win,
48 ECORE_X_ATOM_MOTIF_WM_HINTS,
49 ECORE_X_ATOM_MOTIF_WM_HINTS,
53 mwmhints = (MWMHints *)p;
60 if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS)
61 *dhint = mwmhints->decorations;
63 *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
68 if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
69 *fhint = mwmhints->functions;
71 *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
76 if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
77 *ihint = mwmhints->inputmode;
79 *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;
92 ecore_x_mwm_borderless_set(Ecore_X_Window win,
95 unsigned int data[5] = {0, 0, 0, 0, 0};
97 data[0] = 2; /* just set the decorations hint! */
98 data[2] = !borderless;
100 LOGFN(__FILE__, __LINE__, __FUNCTION__);
101 ecore_x_window_prop_property_set(win,
102 ECORE_X_ATOM_MOTIF_WM_HINTS,
103 ECORE_X_ATOM_MOTIF_WM_HINTS,
104 32, (void *)data, 5);