2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
6 * Various MWM related functions.
8 * This is ALL the code involving anything MWM related. for both WM and
19 #include "ecore_x_private.h"
21 #include "Ecore_X_Atoms.h"
23 #define ECORE_X_MWM_HINTS_FUNCTIONS (1 << 0)
24 #define ECORE_X_MWM_HINTS_DECORATIONS (1 << 1)
25 #define ECORE_X_MWM_HINTS_INPUT_MODE (1 << 2)
26 #define ECORE_X_MWM_HINTS_STATUS (1 << 3)
28 typedef struct _mwmhints
39 ecore_x_mwm_hints_get(Ecore_X_Window win,
40 Ecore_X_MWM_Hint_Func * fhint,
41 Ecore_X_MWM_Hint_Decor * dhint,
42 Ecore_X_MWM_Hint_Input * ihint)
44 unsigned char *p = NULL;
45 MWMHints *mwmhints = NULL;
49 LOGFN(__FILE__, __LINE__, __FUNCTION__);
51 if (!ecore_x_window_prop_property_get(win,
52 ECORE_X_ATOM_MOTIF_WM_HINTS,
53 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;
70 if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
71 *fhint = mwmhints->functions;
73 *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
77 if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
78 *ihint = mwmhints->inputmode;
80 *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;
90 ecore_x_mwm_borderless_set(Ecore_X_Window win, int borderless)
92 unsigned int data[5] = {0, 0, 0, 0, 0};
94 data[0] = 2; /* just set the decorations hint! */
95 data[2] = !borderless;
97 LOGFN(__FILE__, __LINE__, __FUNCTION__);
98 ecore_x_window_prop_property_set(win,
99 ECORE_X_ATOM_MOTIF_WM_HINTS,
100 ECORE_X_ATOM_MOTIF_WM_HINTS,
101 32, (void *)data, 5);