summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2013-02-08 08:56:00 +0000
committerCarsten Haitzler <raster@rasterman.com>2013-02-08 08:56:00 +0000
commitc736dd323d8f11907a8a09dafa887bef5d4e5f01 (patch)
tree9d0f5868abb08cad0be17cc199163d919c584d7c
parent8acf1ebdf2b896e0358dabe5c2347a246d05c19a (diff)
fix ecore_x_screen_is_composited...
SVN revision: 83767
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_netwm.c46
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_netwm.c22
4 files changed, 28 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index aaea3f4a70..8c84505a36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12013-02-08 Carsten Haitzler (The Rasterman)
2
3 * Fix ecore_x ecore_x_screen_is_composited/set() to work
4 properly on multihead.
5
12013-02-07 Christopher Michael (devilhorns) 62013-02-07 Christopher Michael (devilhorns)
2 7
3 * Added ecore_x_randr_crtc_info_free function. 8 * Added ecore_x_randr_crtc_info_free function.
diff --git a/NEWS b/NEWS
index 1b71b71648..dcceef2fce 100644
--- a/NEWS
+++ b/NEWS
@@ -156,3 +156,4 @@ Fixes:
156 * Prevent denial of service on eina_hash function. 156 * Prevent denial of service on eina_hash function.
157 * Fix return type of function ecore_wl_outputs_get(). 157 * Fix return type of function ecore_wl_outputs_get().
158 * Fix memleak in Eina_File. 158 * Fix memleak in Eina_File.
159 * Fix ecore_x_screen_is_composited/set() to work on multihead.
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_netwm.c b/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
index ae801d3407..856e27d07f 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_netwm.c
@@ -585,34 +585,26 @@ ecore_x_screen_is_composited(int screen)
585 char buff[32]; 585 char buff[32];
586 xcb_get_selection_owner_cookie_t ocookie; 586 xcb_get_selection_owner_cookie_t ocookie;
587 xcb_get_selection_owner_reply_t *oreply; 587 xcb_get_selection_owner_reply_t *oreply;
588 xcb_intern_atom_cookie_t acookie;
589 xcb_intern_atom_reply_t *areply;
588 Ecore_X_Window win; 590 Ecore_X_Window win;
589 static Ecore_X_Atom atom = XCB_NONE; 591 Ecore_X_Atom atom;
590 592
591 LOGFN(__FILE__, __LINE__, __FUNCTION__); 593 LOGFN(__FILE__, __LINE__, __FUNCTION__);
592 CHECK_XCB_CONN; 594 CHECK_XCB_CONN;
593 595
594 snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen); 596 snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
595 597 acookie = xcb_intern_atom_unchecked(_ecore_xcb_conn, 1, strlen(buff), buff);
596 if (atom == XCB_NONE) 598 areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
597 { 599 if (!areply) return EINA_FALSE;
598 xcb_intern_atom_cookie_t acookie; 600 atom = areply->atom;
599 xcb_intern_atom_reply_t *areply; 601 free(areply);
600
601 acookie =
602 xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
603 areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
604 if (!areply) return EINA_FALSE;
605 atom = areply->atom;
606 free(areply);
607 }
608 if (atom == XCB_NONE) return EINA_FALSE; 602 if (atom == XCB_NONE) return EINA_FALSE;
609
610 ocookie = xcb_get_selection_owner_unchecked(_ecore_xcb_conn, atom); 603 ocookie = xcb_get_selection_owner_unchecked(_ecore_xcb_conn, atom);
611 oreply = xcb_get_selection_owner_reply(_ecore_xcb_conn, ocookie, NULL); 604 oreply = xcb_get_selection_owner_reply(_ecore_xcb_conn, ocookie, NULL);
612 if (!oreply) return EINA_FALSE; 605 if (!oreply) return EINA_FALSE;
613 win = oreply->owner; 606 win = oreply->owner;
614 free(oreply); 607 free(oreply);
615
616 return (win != XCB_NONE) ? EINA_TRUE : EINA_FALSE; 608 return (win != XCB_NONE) ? EINA_TRUE : EINA_FALSE;
617} 609}
618 610
@@ -620,26 +612,20 @@ EAPI void
620ecore_x_screen_is_composited_set(int screen, 612ecore_x_screen_is_composited_set(int screen,
621 Ecore_X_Window win) 613 Ecore_X_Window win)
622{ 614{
623 static Ecore_X_Atom atom = XCB_NONE; 615 Ecore_X_Atom atom;
616 xcb_intern_atom_cookie_t acookie;
617 xcb_intern_atom_reply_t *areply;
624 char buff[32]; 618 char buff[32];
625 619
626 LOGFN(__FILE__, __LINE__, __FUNCTION__); 620 LOGFN(__FILE__, __LINE__, __FUNCTION__);
627 CHECK_XCB_CONN; 621 CHECK_XCB_CONN;
628 622
629 snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen); 623 snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
630 if (atom == XCB_NONE) 624 acookie = xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
631 { 625 areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
632 xcb_intern_atom_cookie_t acookie; 626 if (!areply) return;
633 xcb_intern_atom_reply_t *areply; 627 atom = areply->atom;
634 628 free(areply);
635 acookie =
636 xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
637 areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
638 if (!areply) return;
639 atom = areply->atom;
640 free(areply);
641 }
642 if (atom == XCB_NONE) return;
643 xcb_set_selection_owner(_ecore_xcb_conn, win, atom, 629 xcb_set_selection_owner(_ecore_xcb_conn, win, atom,
644 _ecore_xcb_events_last_time_get()); 630 _ecore_xcb_events_last_time_get());
645} 631}
diff --git a/src/lib/ecore_x/xlib/ecore_x_netwm.c b/src/lib/ecore_x/xlib/ecore_x_netwm.c
index 3f08af8b9c..90181fc198 100644
--- a/src/lib/ecore_x/xlib/ecore_x_netwm.c
+++ b/src/lib/ecore_x/xlib/ecore_x_netwm.c
@@ -2047,19 +2047,13 @@ EAPI Eina_Bool
2047ecore_x_screen_is_composited(int screen) 2047ecore_x_screen_is_composited(int screen)
2048{ 2048{
2049 Ecore_X_Window win; 2049 Ecore_X_Window win;
2050 static Ecore_X_Atom atom = None; 2050 Ecore_X_Atom atom;
2051 char buf[32]; 2051 char buf[32];
2052 2052
2053 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2053 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2054 snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen); 2054 atom = XInternAtom(_ecore_x_disp, buf, True);
2055 if (atom == None) 2055 if (atom == None) return EINA_FALSE;
2056 atom = XInternAtom(_ecore_x_disp, buf, False);
2057
2058 if (atom == None)
2059 return EINA_FALSE;
2060
2061 win = XGetSelectionOwner(_ecore_x_disp, atom); 2056 win = XGetSelectionOwner(_ecore_x_disp, atom);
2062
2063 return (win != None) ? EINA_TRUE : EINA_FALSE; 2057 return (win != None) ? EINA_TRUE : EINA_FALSE;
2064} 2058}
2065 2059
@@ -2067,17 +2061,13 @@ EAPI void
2067ecore_x_screen_is_composited_set(int screen, 2061ecore_x_screen_is_composited_set(int screen,
2068 Ecore_X_Window win) 2062 Ecore_X_Window win)
2069{ 2063{
2070 static Ecore_X_Atom atom = None; 2064 Ecore_X_Atom atom;
2071 char buf[32]; 2065 char buf[32];
2072 2066
2073 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2067 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2074 snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen); 2068 snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen);
2075 if (atom == None) 2069 atom = XInternAtom(_ecore_x_disp, buf, False);
2076 atom = XInternAtom(_ecore_x_disp, buf, False); 2070 if (atom == None) return;
2077
2078 if (atom == None)
2079 return;
2080
2081 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time); 2071 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time);
2082} 2072}
2083 2073