ecore_x: add API to request selection changed events for diff. wins
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Sun, 12 Jan 2020 16:36:48 +0000 (17:36 +0100)
committerTaehyub Kim <taehyub.kim@samsung.com>
Tue, 10 Mar 2020 10:54:35 +0000 (19:54 +0900)
we need that in order to get seleciton per window events, which is
required to get a nice mapping onto the ecore_evas object.

Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11193

src/lib/ecore_x/Ecore_X.h
src/lib/ecore_x/ecore_x_fixes.c

index bb5aedf..94b612a 100644 (file)
@@ -2444,6 +2444,15 @@ EAPI void               ecore_x_root_screen_barriers_set(Ecore_X_Rectangle *scre
  */
 EAPI Eina_Bool          ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection);
 
+/**
+ * xfixes selection notification request.
+ *
+ * In addition to ecore_x_fixes_selection_notification_request you can also specify for which window you want to get them
+ * @since 1.24
+ */
+EAPI Eina_Bool          ecore_x_fixes_window_selection_notification_request(Ecore_X_Window window, Ecore_X_Atom selection);
+
+
 /* XComposite Extension Support */
 EAPI Eina_Bool          ecore_x_composite_query(void);
 EAPI void               ecore_x_composite_redirect_window(Ecore_X_Window win, Ecore_X_Composite_Update_Type type);
index 5582c3e..4b659c2 100644 (file)
@@ -112,6 +112,26 @@ ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
    return EINA_FALSE;
 }
 
+EAPI Eina_Bool
+ecore_x_fixes_window_selection_notification_request(Ecore_X_Window window, Ecore_X_Atom selection)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
+
+#ifdef ECORE_XFIXES
+   if (_fixes_available)
+     {
+        XFixesSelectSelectionInput (_ecore_x_disp,
+                                    window,
+                                    selection,
+                                    XFixesSetSelectionOwnerNotifyMask |
+                                    XFixesSelectionWindowDestroyNotifyMask |
+                                    XFixesSelectionClientCloseNotifyMask);
+        return EINA_TRUE;
+     }
+#endif
+   return EINA_FALSE;
+}
+
 EAPI Ecore_X_Region
 ecore_x_region_new(Ecore_X_Rectangle *rects,
                    int num)