[mutter/wayland] Move request_take_focus to window-x11
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wayland] Move request_take_focus to window-x11
- Date: Thu, 20 Mar 2014 20:25:19 +0000 (UTC)
commit 46b4d6c0f0982498270f36ff6a0b75112671286b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Mar 20 16:06:24 2014 -0400
Move request_take_focus to window-x11
This will let us kill off send_icccm_message
src/core/display-private.h | 2 ++
src/core/display.c | 24 ++++--------------------
src/meta/display.h | 4 ----
src/x11/window-x11.c | 16 +++++++++++++---
4 files changed, 19 insertions(+), 27 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 3194afc..8859401 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -498,5 +498,7 @@ void meta_display_update_focus_window (MetaDisplay *display,
void meta_display_sanity_check_timestamps (MetaDisplay *display,
guint32 timestamp);
+gboolean meta_display_timestamp_too_old (MetaDisplay *display,
+ guint32 *timestamp);
#endif
diff --git a/src/core/display.c b/src/core/display.c
index 2910c69..1eb39ec 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1700,9 +1700,9 @@ meta_display_update_focus_window (MetaDisplay *display,
meta_display_update_active_window_hint (display);
}
-static gboolean
-timestamp_too_old (MetaDisplay *display,
- guint32 *timestamp)
+gboolean
+meta_display_timestamp_too_old (MetaDisplay *display,
+ guint32 *timestamp)
{
/* FIXME: If Soeren's suggestion in bug 151984 is implemented, it will allow
* us to sanity check the timestamp here and ensure it doesn't correspond to
@@ -1738,7 +1738,7 @@ request_xserver_input_focus_change (MetaDisplay *display,
{
gulong serial;
- if (timestamp_too_old (display, ×tamp))
+ if (meta_display_timestamp_too_old (display, ×tamp))
return;
meta_error_trap_push (display);
@@ -3405,22 +3405,6 @@ meta_display_set_input_focus_window (MetaDisplay *display,
}
void
-meta_display_request_take_focus (MetaDisplay *display,
- MetaWindow *window,
- guint32 timestamp)
-{
- if (timestamp_too_old (display, ×tamp))
- return;
-
- meta_topic (META_DEBUG_FOCUS, "WM_TAKE_FOCUS(%s, %u)\n",
- window->desc, timestamp);
-
- meta_window_send_icccm_message (window,
- display->atom_WM_TAKE_FOCUS,
- timestamp);
-}
-
-void
meta_display_set_input_focus_xwindow (MetaDisplay *display,
MetaScreen *screen,
Window window,
diff --git a/src/meta/display.h b/src/meta/display.h
index 60e9ab1..c882ac4 100644
--- a/src/meta/display.h
+++ b/src/meta/display.h
@@ -163,10 +163,6 @@ void meta_display_set_input_focus_window (MetaDisplay *display,
gboolean focus_frame,
guint32 timestamp);
-void meta_display_request_take_focus (MetaDisplay *display,
- MetaWindow *window,
- guint32 timestamp);
-
/* meta_display_focus_the_no_focus_window is called when the
* designated no_focus_window should be focused, but is otherwise the
* same as meta_display_set_input_focus_window
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index aae5906..58c3d19 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -387,6 +387,18 @@ meta_window_x11_kill (MetaWindow *window)
}
static void
+request_take_focus (MetaWindow *window,
+ guint32 timestamp)
+{
+ MetaDisplay *display = window->display;
+
+ meta_topic (META_DEBUG_FOCUS, "WM_TAKE_FOCUS(%s, %u)\n",
+ window->desc, timestamp);
+
+ meta_window_send_icccm_message (window, display->atom_WM_TAKE_FOCUS, timestamp);
+}
+
+static void
meta_window_x11_focus (MetaWindow *window,
guint32 timestamp)
{
@@ -448,9 +460,7 @@ meta_window_x11_focus (MetaWindow *window,
timestamp);
}
- meta_display_request_take_focus (window->display,
- window,
- timestamp);
+ request_take_focus (window, timestamp);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]