forked from AuroraMiddleware/gtk
Remove some more deprecated display API
gdk_display_get_pointer, gdk_display_get_window_at_pointer and gdk_display_warp_pointer have long been deprecated.
This commit is contained in:
parent
ee7ddefce9
commit
1396d6c92a
@ -114,9 +114,6 @@ gdk_display_put_event
|
||||
gdk_display_has_pending
|
||||
gdk_display_set_double_click_time
|
||||
gdk_display_set_double_click_distance
|
||||
gdk_display_get_pointer
|
||||
gdk_display_get_window_at_pointer
|
||||
gdk_display_warp_pointer
|
||||
gdk_display_supports_cursor_color
|
||||
gdk_display_supports_cursor_alpha
|
||||
gdk_display_get_default_cursor_size
|
||||
|
128
gdk/gdkdisplay.c
128
gdk/gdkdisplay.c
@ -570,97 +570,6 @@ _gdk_display_enable_motion_hints (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_pointer:
|
||||
* @display: a #GdkDisplay
|
||||
* @screen: (out) (allow-none) (transfer none): location to store the screen that the
|
||||
* cursor is on, or %NULL.
|
||||
* @x: (out) (allow-none): location to store root window X coordinate of pointer, or %NULL.
|
||||
* @y: (out) (allow-none): location to store root window Y coordinate of pointer, or %NULL.
|
||||
* @mask: (out) (allow-none): location to store current modifier mask, or %NULL
|
||||
*
|
||||
* Gets the current location of the pointer and the current modifier
|
||||
* mask for a given display.
|
||||
*
|
||||
* Since: 2.2
|
||||
*
|
||||
* Deprecated: 3.0: Use gdk_device_get_position() instead.
|
||||
**/
|
||||
void
|
||||
gdk_display_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
GdkScreen *default_screen;
|
||||
GdkSeat *default_seat;
|
||||
GdkWindow *root;
|
||||
gdouble tmp_x, tmp_y;
|
||||
GdkModifierType tmp_mask;
|
||||
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
if (gdk_display_is_closed (display))
|
||||
return;
|
||||
|
||||
default_screen = gdk_display_get_default_screen (display);
|
||||
default_seat = gdk_display_get_default_seat (display);
|
||||
|
||||
/* We call _gdk_device_query_state() here manually instead of
|
||||
* gdk_device_get_position() because we care about the modifier mask */
|
||||
|
||||
_gdk_device_query_state (gdk_seat_get_pointer (default_seat),
|
||||
gdk_screen_get_root_window (default_screen),
|
||||
&root, NULL,
|
||||
&tmp_x, &tmp_y,
|
||||
NULL, NULL,
|
||||
&tmp_mask);
|
||||
|
||||
if (screen)
|
||||
*screen = gdk_window_get_screen (root);
|
||||
if (x)
|
||||
*x = round (tmp_x);
|
||||
if (y)
|
||||
*y = round (tmp_y);
|
||||
if (mask)
|
||||
*mask = tmp_mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_get_window_at_pointer:
|
||||
* @display: a #GdkDisplay
|
||||
* @win_x: (out) (allow-none): return location for x coordinate of the pointer location relative
|
||||
* to the window origin, or %NULL
|
||||
* @win_y: (out) (allow-none): return location for y coordinate of the pointer location relative
|
||||
& to the window origin, or %NULL
|
||||
*
|
||||
* Obtains the window underneath the mouse pointer, returning the location
|
||||
* of the pointer in that window in @win_x, @win_y for @screen. Returns %NULL
|
||||
* if the window under the mouse pointer is not known to GDK (for example,
|
||||
* belongs to another application).
|
||||
*
|
||||
* Returns: (nullable) (transfer none): the window under the mouse
|
||||
* pointer, or %NULL
|
||||
*
|
||||
* Since: 2.2
|
||||
*
|
||||
* Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
|
||||
**/
|
||||
GdkWindow *
|
||||
gdk_display_get_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
{
|
||||
GdkDevice *pointer;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
||||
|
||||
pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
|
||||
|
||||
return gdk_device_get_window_at_position (pointer, win_x, win_y);
|
||||
}
|
||||
|
||||
static void
|
||||
generate_grab_broken_event (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
@ -1841,43 +1750,6 @@ gdk_display_get_maximal_cursor_size (GdkDisplay *display,
|
||||
height);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_warp_pointer:
|
||||
* @display: a #GdkDisplay
|
||||
* @screen: the screen of @display to warp the pointer to
|
||||
* @x: the x coordinate of the destination
|
||||
* @y: the y coordinate of the destination
|
||||
*
|
||||
* Warps the pointer of @display to the point @x,@y on
|
||||
* the screen @screen, unless the pointer is confined
|
||||
* to a window by a grab, in which case it will be moved
|
||||
* as far as allowed by the grab. Warping the pointer
|
||||
* creates events as if the user had moved the mouse
|
||||
* instantaneously to the destination.
|
||||
*
|
||||
* Note that the pointer should normally be under the
|
||||
* control of the user. This function was added to cover
|
||||
* some rare use cases like keyboard navigation support
|
||||
* for the color picker in the #GtkColorSelectionDialog.
|
||||
*
|
||||
* Since: 2.8
|
||||
*
|
||||
* Deprecated: 3.0: Use gdk_device_warp() instead.
|
||||
*/
|
||||
void
|
||||
gdk_display_warp_pointer (GdkDisplay *display,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
GdkDevice *pointer;
|
||||
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
|
||||
gdk_device_warp (pointer, screen, x, y);
|
||||
}
|
||||
|
||||
gulong
|
||||
_gdk_display_get_next_serial (GdkDisplay *display)
|
||||
{
|
||||
|
@ -85,24 +85,6 @@ void gdk_display_set_double_click_distance (GdkDisplay *display,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkDisplay *gdk_display_get_default (void);
|
||||
|
||||
#ifndef GDK_MULTIDEVICE_SAFE
|
||||
GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_position)
|
||||
void gdk_display_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_window_at_position)
|
||||
GdkWindow * gdk_display_get_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
GDK_DEPRECATED_IN_3_0_FOR(gdk_device_warp)
|
||||
void gdk_display_warp_pointer (GdkDisplay *display,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y);
|
||||
#endif /* GDK_MULTIDEVICE_SAFE */
|
||||
|
||||
GDK_DEPRECATED_IN_3_16
|
||||
GdkDisplay *gdk_display_open_default_libgtk_only (void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user