summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x/ecore_x_mwm.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-11-01 23:04:47 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-11-03 22:22:54 +0900
commit4ed2e01591e1575800d9aa871f76a5f7559060b3 (patch)
treee2ff598e015fecd3f26a9c717a2bae1334e1bb1d /src/lib/ecore_x/ecore_x_mwm.c
parentf399e77a92fc6d2cf92ab097eebc984a039bf223 (diff)
remove xcb support in ecore_x and evas engines as per mailing list
as per mailing list discussion about dropping xcb support now. it hasn't been complete for a long time, thus not recommented for being turned on. as we are moving to a wayland world xcbmakes even less sense. as agreed, time to clean up a bit and remove a distraction as well as not well tested code. this also updates po's too. @feature
Diffstat (limited to 'src/lib/ecore_x/ecore_x_mwm.c')
-rw-r--r--src/lib/ecore_x/ecore_x_mwm.c109
1 files changed, 109 insertions, 0 deletions
diff --git a/src/lib/ecore_x/ecore_x_mwm.c b/src/lib/ecore_x/ecore_x_mwm.c
new file mode 100644
index 0000000..c2d298b
--- /dev/null
+++ b/src/lib/ecore_x/ecore_x_mwm.c
@@ -0,0 +1,109 @@
1/*
2 * Various MWM related functions.
3 *
4 * This is ALL the code involving anything MWM related. for both WM and
5 * client.
6 */
7
8#ifdef HAVE_CONFIG_H
9# include <config.h>
10#endif /* ifdef HAVE_CONFIG_H */
11
12#include <stdlib.h>
13
14#include "Ecore.h"
15#include "ecore_x_private.h"
16#include "Ecore_X.h"
17#include "Ecore_X_Atoms.h"
18
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)
23
24typedef struct _mwmhints
25{
26 CARD32 flags;
27 CARD32 functions;
28 CARD32 decorations;
29 INT32 inputmode;
30 CARD32 status;
31}
32MWMHints;
33
34EAPI Eina_Bool
35ecore_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)
39{
40 unsigned char *p = NULL;
41 MWMHints *mwmhints = NULL;
42 int num;
43 Eina_Bool ret;
44
45 LOGFN(__FILE__, __LINE__, __FUNCTION__);
46 ret = EINA_FALSE;
47 if (!ecore_x_window_prop_property_get(win,
48 ECORE_X_ATOM_MOTIF_WM_HINTS,
49 ECORE_X_ATOM_MOTIF_WM_HINTS,
50 32, &p, &num))
51 {
52 if (p) free(p);
53 return EINA_FALSE;
54 }
55
56 mwmhints = (MWMHints *)p;
57 if (mwmhints)
58 {
59 if (num >= 4)
60 {
61 if (dhint)
62 {
63 if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS)
64 *dhint = mwmhints->decorations;
65 else
66 *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
67 }
68
69 if (fhint)
70 {
71 if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
72 *fhint = mwmhints->functions;
73 else
74 *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
75 }
76
77 if (ihint)
78 {
79 if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
80 *ihint = mwmhints->inputmode;
81 else
82 *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;
83 }
84
85 ret = EINA_TRUE;
86 }
87
88 free(mwmhints);
89 }
90
91 return ret;
92}
93
94EAPI void
95ecore_x_mwm_borderless_set(Ecore_X_Window win,
96 Eina_Bool borderless)
97{
98 unsigned int data[5] = {0, 0, 0, 0, 0};
99
100 data[0] = 2; /* just set the decorations hint! */
101 data[2] = !borderless;
102
103 LOGFN(__FILE__, __LINE__, __FUNCTION__);
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);
108}
109