This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit 5ad736c3daa34c1471d16e1d993ebd23b7bf76f6
Author: Swagtoy <m...@ow.swag.toys>
AuthorDate: Fri Jun 27 13:10:27 2025 -0400

    Ecore_X: Use ifdef and global variable and add comments
---
 src/lib/ecore_x/Ecore_X.h |  6 ++++--
 src/lib/ecore_x/ecore_x.c | 32 ++++++++++++++++++++++++++------
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index 555a79c0c1..ce50500719 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -2066,8 +2066,10 @@ EAPI void             ecore_x_window_button_ungrab(Ecore_X_Window win, int butto
 EAPI void             ecore_x_window_key_grab(Ecore_X_Window win, const char *key, int mod, int any_mod);
 EAPI void             ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key, int mod, int any_mod);
 
-EAPI Eina_Bool        ecore_x_keyboard_repeat_set(Ecore_X_Display *display, Ecore_X_Keyboard_Repeat *repeat);
-EAPI Eina_Bool        ecore_x_keyboard_repeat_get(Ecore_X_Display *display, Ecore_X_Keyboard_Repeat *repeat);
+#ifdef ECORE_XKB
+EAPI Eina_Bool        ecore_x_keyboard_repeat_set(Ecore_X_Keyboard_Repeat *repeat);
+EAPI Eina_Bool        ecore_x_keyboard_repeat_get(Ecore_X_Keyboard_Repeat *repeat);
+#endif /* ECORE_XKB */
 
 EAPI void             ecore_x_focus_reset(void);
 EAPI void             ecore_x_events_allow_all(void);
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index 8f9d758d86..0d22d92bd7 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -2117,11 +2117,19 @@ _ecore_x_key_grab_resume(void)
      }
 }
 
+#ifdef ECORE_XKB
+/**
+ * Sets the keyboard repeat info.
+ *
+ * @param repeat   Values to set
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
 EAPI Eina_Bool
-ecore_x_keyboard_repeat_set(Ecore_X_Display *display, Ecore_X_Keyboard_Repeat *repeat)
+ecore_x_keyboard_repeat_set(Ecore_X_Keyboard_Repeat *repeat)
 {
    XkbDescPtr xkb = XkbAllocKeyboard();
-   if (!xkb || XkbGetControls(display, XkbRepeatKeysMask, xkb) != Success)
+   if (!xkb || XkbGetControls(_ecore_x_disp, XkbRepeatKeysMask, xkb) != Success)
      {
 	    if (xkb)
 		  XkbFreeKeyboard(xkb, 0, True);
@@ -2130,16 +2138,27 @@ ecore_x_keyboard_repeat_set(Ecore_X_Display *display, Ecore_X_Keyboard_Repeat *r
    
    xkb->ctrls->repeat_delay = repeat->delay;
    xkb->ctrls->repeat_interval = repeat->rate;
-   XkbSetControls(display, XkbRepeatKeysMask, xkb);
+   if (XkbSetControls(_ecore_x_disp, XkbRepeatKeysMask, xkb) == False)
+     {
+        XkbFreeKeyboard(xkb, 0, True);
+		return EINA_FALSE;
+     }
    XkbFreeKeyboard(xkb, 0, True);
    return EINA_TRUE;
 }
 
+/**
+ * Gets the current keyboard repeat info.
+ *
+ * @param repeat   Pointer to struct to fill parameters in.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ */
 EAPI Eina_Bool
-ecore_x_keyboard_repeat_get(Ecore_X_Display *display, Ecore_X_Keyboard_Repeat *repeat)
+ecore_x_keyboard_repeat_get(Ecore_X_Keyboard_Repeat *repeat)
 {
 	XkbDescPtr xkb = XkbAllocKeyboard();
-	if (!xkb || XkbGetControls(display, XkbRepeatKeysMask, xkb) != Success)
+	if (!xkb || XkbGetControls(_ecore_x_disp, XkbRepeatKeysMask, xkb) != Success)
 	  {
 	     if (xkb)
 		   XkbFreeKeyboard(xkb, 0, True);
@@ -2151,6 +2170,7 @@ ecore_x_keyboard_repeat_get(Ecore_X_Display *display, Ecore_X_Keyboard_Repeat *r
 	XkbFreeKeyboard(xkb, 0, True);
 	return EINA_TRUE;
 }
+#endif /* ECORE_XKB */
 
 /**
  * Send client message with given type and format 32.
@@ -2164,7 +2184,7 @@ ecore_x_keyboard_repeat_get(Ecore_X_Display *display, Ecore_X_Keyboard_Repeat *r
  * @param d3      The client message data item 4
  * @param d4      The client message data item 5
  *
- * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
  */
 EAPI Eina_Bool
 ecore_x_client_message32_send(Ecore_X_Window win,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to