aboutsummaryrefslogtreecommitdiffstats
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)
downloadefl-c736dd323d8f11907a8a09dafa887bef5d4e5f01.tar.gz
efl-c736dd323d8f11907a8a09dafa887bef5d4e5f01.tar.xz
efl-c736dd323d8f11907a8a09dafa887bef5d4e5f01.zip
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 aaea3f4a7..8c84505a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-08 Carsten Haitzler (The Rasterman)
+
+ * Fix ecore_x ecore_x_screen_is_composited/set() to work
+ properly on multihead.
+
2013-02-07 Christopher Michael (devilhorns)
* Added ecore_x_randr_crtc_info_free function.
diff --git a/NEWS b/NEWS
index 1b71b7164..dcceef2fc 100644
--- a/NEWS
+++ b/NEWS
@@ -156,3 +156,4 @@ Fixes:
* Prevent denial of service on eina_hash function.
* Fix return type of function ecore_wl_outputs_get().
* Fix memleak in Eina_File.
+ * 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 ae801d340..856e27d07 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)
char buff[32];
xcb_get_selection_owner_cookie_t ocookie;
xcb_get_selection_owner_reply_t *oreply;
+ xcb_intern_atom_cookie_t acookie;
+ xcb_intern_atom_reply_t *areply;
Ecore_X_Window win;
- static Ecore_X_Atom atom = XCB_NONE;
+ Ecore_X_Atom atom;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
-
- if (atom == XCB_NONE)
- {
- xcb_intern_atom_cookie_t acookie;
- xcb_intern_atom_reply_t *areply;
-
- acookie =
- xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
- areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
- if (!areply) return EINA_FALSE;
- atom = areply->atom;
- free(areply);
- }
+ acookie = xcb_intern_atom_unchecked(_ecore_xcb_conn, 1, strlen(buff), buff);
+ areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
+ if (!areply) return EINA_FALSE;
+ atom = areply->atom;
+ free(areply);
if (atom == XCB_NONE) return EINA_FALSE;
-
ocookie = xcb_get_selection_owner_unchecked(_ecore_xcb_conn, atom);
oreply = xcb_get_selection_owner_reply(_ecore_xcb_conn, ocookie, NULL);
if (!oreply) return EINA_FALSE;
win = oreply->owner;
free(oreply);
-
return (win != XCB_NONE) ? EINA_TRUE : EINA_FALSE;
}
@@ -620,26 +612,20 @@ EAPI void
ecore_x_screen_is_composited_set(int screen,
Ecore_X_Window win)
{
- static Ecore_X_Atom atom = XCB_NONE;
+ Ecore_X_Atom atom;
+ xcb_intern_atom_cookie_t acookie;
+ xcb_intern_atom_reply_t *areply;
char buff[32];
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
- if (atom == XCB_NONE)
- {
- xcb_intern_atom_cookie_t acookie;
- xcb_intern_atom_reply_t *areply;
-
- acookie =
- xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
- areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
- if (!areply) return;
- atom = areply->atom;
- free(areply);
- }
- if (atom == XCB_NONE) return;
+ acookie = xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(buff), buff);
+ areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL);
+ if (!areply) return;
+ atom = areply->atom;
+ free(areply);
xcb_set_selection_owner(_ecore_xcb_conn, win, atom,
_ecore_xcb_events_last_time_get());
}
diff --git a/src/lib/ecore_x/xlib/ecore_x_netwm.c b/src/lib/ecore_x/xlib/ecore_x_netwm.c
index 3f08af8b9..90181fc19 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
ecore_x_screen_is_composited(int screen)
{
Ecore_X_Window win;
- static Ecore_X_Atom atom = None;
+ Ecore_X_Atom atom;
char buf[32];
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen);
- if (atom == None)
- atom = XInternAtom(_ecore_x_disp, buf, False);
-
- if (atom == None)
- return EINA_FALSE;
-
+ atom = XInternAtom(_ecore_x_disp, buf, True);
+ if (atom == None) return EINA_FALSE;
win = XGetSelectionOwner(_ecore_x_disp, atom);
-
return (win != None) ? EINA_TRUE : EINA_FALSE;
}
@@ -2067,17 +2061,13 @@ EAPI void
ecore_x_screen_is_composited_set(int screen,
Ecore_X_Window win)
{
- static Ecore_X_Atom atom = None;
+ Ecore_X_Atom atom;
char buf[32];
LOGFN(__FILE__, __LINE__, __FUNCTION__);
snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen);
- if (atom == None)
- atom = XInternAtom(_ecore_x_disp, buf, False);
-
- if (atom == None)
- return;
-
+ atom = XInternAtom(_ecore_x_disp, buf, False);
+ if (atom == None) return;
XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time);
}