summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x/xcb/ecore_xcb_randr.c
diff options
context:
space:
mode:
authorBenjamin Jacobs <benj@spam.thsi.be>2016-06-06 15:46:00 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-06-06 15:46:24 -0400
commit109d040e3d4a2ffa7c13d56f0f759974f6c6a231 (patch)
tree4ab0ef2beb7dd3173c6e03a865edde0c1d4315d7 /src/lib/ecore_x/xcb/ecore_xcb_randr.c
parent0554d2ef124000c19fd3d87fab85d9f74ebd872e (diff)
ecore-xcb: Fix XCB to be usable again
Summary: Well mostly, it seems there is an issue with multi-key events and enlightenment. Let's merge this first before opening a ticket. Reviewers: devilhorns Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4017 @fix
Diffstat (limited to 'src/lib/ecore_x/xcb/ecore_xcb_randr.c')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_randr.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index 2b44fc3b31..74ae2f8aec 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -55,6 +55,11 @@
55 _ECORE_X_RANDR_EDID_FOR_EACH_DESCRIPTOR_BLOCK(edid, block) \ 55 _ECORE_X_RANDR_EDID_FOR_EACH_DESCRIPTOR_BLOCK(edid, block) \
56 if ((block[0] == 0) && (block[1] == 0)) 56 if ((block[0] == 0) && (block[1] == 0))
57 57
58#ifdef ECORE_XCB_RANDR
59# define RANDR_VALIDATE_ROOT(screen, root) \
60 ((screen = _ecore_xcb_randr_root_to_screen(root)) != -1)
61#endif
62
58/* local function prototypes */ 63/* local function prototypes */
59static Eina_Bool _ecore_xcb_randr_output_validate(Ecore_X_Window root, 64static Eina_Bool _ecore_xcb_randr_output_validate(Ecore_X_Window root,
60 Ecore_X_Randr_Output output); 65 Ecore_X_Randr_Output output);
@@ -189,8 +194,6 @@ _ecore_xcb_randr_root_validate(Ecore_X_Window root EINA_UNUSED)
189{ 194{
190#ifdef ECORE_XCB_RANDR 195#ifdef ECORE_XCB_RANDR
191 Ecore_X_Randr_Screen scr = -1; 196 Ecore_X_Randr_Screen scr = -1;
192# define RANDR_VALIDATE_ROOT(screen, root) \
193 ((screen == _ecore_xcb_randr_root_to_screen(root)) != -1)
194#endif 197#endif
195 198
196 LOGFN(__FILE__, __LINE__, __FUNCTION__); 199 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2601,8 +2604,6 @@ ecore_x_randr_screen_current_size_get(Ecore_X_Window root,
2601#ifdef ECORE_XCB_RANDR 2604#ifdef ECORE_XCB_RANDR
2602 Ecore_X_Randr_Screen scr = 0; 2605 Ecore_X_Randr_Screen scr = 0;
2603 xcb_screen_t *s; 2606 xcb_screen_t *s;
2604# define RANDR_VALIDATE_ROOT(screen, root) \
2605 ((screen == _ecore_xcb_randr_root_to_screen(root)) != -1)
2606#endif 2607#endif
2607 2608
2608 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2609 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2647,8 +2648,6 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
2647 Ecore_X_Randr_Screen scr; 2648 Ecore_X_Randr_Screen scr;
2648 int wc = 0, hc = 0, w_mm_c = 0, h_mm_c = 0; 2649 int wc = 0, hc = 0, w_mm_c = 0, h_mm_c = 0;
2649 int mw = 0, mh = 0, xw = 0, xh = 0; 2650 int mw = 0, mh = 0, xw = 0, xh = 0;
2650# define RANDR_VALIDATE_ROOT(screen, root) \
2651 ((screen == _ecore_xcb_randr_root_to_screen(root)) != -1)
2652#endif 2651#endif
2653 2652
2654 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2653 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -4040,14 +4039,16 @@ _ecore_xcb_randr_12_output_name_get(Ecore_X_Window root,
4040 uint8_t *nbuf; 4039 uint8_t *nbuf;
4041 4040
4042 nbuf = xcb_randr_get_output_info_name(oreply); 4041 nbuf = xcb_randr_get_output_info_name(oreply);
4043 nbuf += oreply->name_len;
4044 4042
4045 if (len) *len = oreply->name_len; 4043 if (len) *len = oreply->name_len;
4046 if (oreply->name_len > 0) 4044 if (oreply->name_len > 0)
4047 { 4045 {
4048 ret = malloc(oreply->name_len + 1); 4046 ret = malloc(oreply->name_len + 1);
4049 if (ret) 4047 if (ret)
4050 memcpy(ret, nbuf, oreply->name_len + 1); 4048 {
4049 memcpy(ret, nbuf, oreply->name_len + 1);
4050 ret[oreply->name_len] = '\0';
4051 }
4051 } 4052 }
4052 4053
4053 free(oreply); 4054 free(oreply);
@@ -4083,14 +4084,16 @@ _ecore_xcb_randr_13_output_name_get(Ecore_X_Window root,
4083 uint8_t *nbuf; 4084 uint8_t *nbuf;
4084 4085
4085 nbuf = xcb_randr_get_output_info_name(oreply); 4086 nbuf = xcb_randr_get_output_info_name(oreply);
4086 nbuf += oreply->name_len;
4087 4087
4088 if (len) *len = oreply->name_len; 4088 if (len) *len = oreply->name_len;
4089 if (oreply->name_len > 0) 4089 if (oreply->name_len > 0)
4090 { 4090 {
4091 ret = malloc(oreply->name_len + 1); 4091 ret = malloc(oreply->name_len + 1);
4092 if (ret) 4092 if (ret)
4093 memcpy(ret, nbuf, oreply->name_len + 1); 4093 {
4094 memcpy(ret, nbuf, oreply->name_len + 1);
4095 ret[oreply->name_len] = '\0';
4096 }
4094 } 4097 }
4095 4098
4096 free(oreply); 4099 free(oreply);