Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gtk
Commits
a3cffa50
Commit
a3cffa50
authored
Oct 31, 2017
by
Matthias Clasen
Browse files
Drop GdkScreen from GdkDevice apis
Returning the screen does not add anything here and GdkScreen is going away.
parent
f8cad198
Changes
21
Hide whitespace changes
Inline
Side-by-side
gdk/broadway/gdkdevice-broadway.c
View file @
a3cffa50
...
...
@@ -37,7 +37,6 @@ static void gdk_broadway_device_set_window_cursor (GdkDevice *device,
GdkWindow
*
window
,
GdkCursor
*
cursor
);
static
void
gdk_broadway_device_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
);
static
void
gdk_broadway_device_query_state
(
GdkDevice
*
device
,
...
...
@@ -133,7 +132,6 @@ gdk_broadway_device_set_window_cursor (GdkDevice *device,
static
void
gdk_broadway_device_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
...
...
gdk/gdkdevice.c
View file @
a3cffa50
...
...
@@ -565,8 +565,6 @@ gdk_device_get_state (GdkDevice *device,
/**
* gdk_device_get_position_double:
* @device: pointer device to query status about.
* @screen: (out) (transfer none) (allow-none): location to store the #GdkScreen
* the @device is on, or %NULL.
* @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
* @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
*
...
...
@@ -579,13 +577,11 @@ gdk_device_get_state (GdkDevice *device,
**/
void
gdk_device_get_position_double
(
GdkDevice
*
device
,
GdkScreen
**
screen
,
gdouble
*
x
,
gdouble
*
y
)
{
GdkDisplay
*
display
;
gdouble
tmp_x
,
tmp_y
;
GdkScreen
*
default_screen
;
g_return_if_fail
(
GDK_IS_DEVICE
(
device
));
g_return_if_fail
(
gdk_device_get_source
(
device
)
!=
GDK_SOURCE_KEYBOARD
);
...
...
@@ -595,16 +591,12 @@ gdk_device_get_position_double (GdkDevice *device,
g_return_if_fail
(
gdk_device_get_device_type
(
device
)
!=
GDK_DEVICE_TYPE_SLAVE
||
gdk_display_device_is_grabbed
(
display
,
device
));
default_screen
=
gdk_display_get_default_screen
(
display
);
_gdk_device_query_state
(
device
,
NULL
,
NULL
,
&
tmp_x
,
&
tmp_y
,
NULL
,
NULL
,
NULL
);
if
(
screen
)
*
screen
=
default_screen
;
if
(
x
)
*
x
=
tmp_x
;
if
(
y
)
...
...
@@ -614,8 +606,6 @@ gdk_device_get_position_double (GdkDevice *device,
/**
* gdk_device_get_position:
* @device: pointer device to query status about.
* @screen: (out) (transfer none) (allow-none): location to store the #GdkScreen
* the @device is on, or %NULL.
* @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
* @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
*
...
...
@@ -627,14 +617,13 @@ gdk_device_get_position_double (GdkDevice *device,
* Since: 3.0
**/
void
gdk_device_get_position
(
GdkDevice
*
device
,
GdkScreen
**
screen
,
gint
*
x
,
gint
*
y
)
gdk_device_get_position
(
GdkDevice
*
device
,
gint
*
x
,
gint
*
y
)
{
gdouble
tmp_x
,
tmp_y
;
gdk_device_get_position_double
(
device
,
screen
,
&
tmp_x
,
&
tmp_y
);
gdk_device_get_position_double
(
device
,
&
tmp_x
,
&
tmp_y
);
if
(
x
)
*
x
=
round
(
tmp_x
);
if
(
y
)
...
...
@@ -1511,13 +1500,12 @@ gdk_device_ungrab (GdkDevice *device,
/**
* gdk_device_warp:
* @device: the device to warp.
* @screen: the screen to warp @device to.
* @x: the X coordinate of the destination.
* @y: the Y coordinate of the destination.
*
* Warps @device in @display to the point @x,@y
on
*
the screen @screen,
unless the device is confined
*
to a window by a grab,
in which case it will be moved
* Warps @device in @display to the point @x,@y
,
* unless the device 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.
...
...
@@ -1531,15 +1519,12 @@ gdk_device_ungrab (GdkDevice *device,
**/
void
gdk_device_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gint
x
,
gint
y
)
{
g_return_if_fail
(
GDK_IS_DEVICE
(
device
));
g_return_if_fail
(
GDK_IS_SCREEN
(
screen
));
g_return_if_fail
(
gdk_device_get_display
(
device
)
==
gdk_screen_get_display
(
screen
));
GDK_DEVICE_GET_CLASS
(
device
)
->
warp
(
device
,
screen
,
x
,
y
);
GDK_DEVICE_GET_CLASS
(
device
)
->
warp
(
device
,
x
,
y
);
}
/* Private API */
...
...
gdk/gdkdevice.h
View file @
a3cffa50
...
...
@@ -169,7 +169,6 @@ void gdk_device_get_state (GdkDevice *device,
GdkModifierType
*
mask
);
GDK_AVAILABLE_IN_ALL
void
gdk_device_get_position
(
GdkDevice
*
device
,
GdkScreen
**
screen
,
gint
*
x
,
gint
*
y
);
GDK_AVAILABLE_IN_ALL
...
...
@@ -180,7 +179,6 @@ GdkWindow *
gint
*
win_y
);
GDK_AVAILABLE_IN_3_10
void
gdk_device_get_position_double
(
GdkDevice
*
device
,
GdkScreen
**
screen
,
gdouble
*
x
,
gdouble
*
y
);
GDK_AVAILABLE_IN_3_10
...
...
@@ -241,7 +239,6 @@ void gdk_device_ungrab (GdkDevice *device,
GDK_AVAILABLE_IN_ALL
void
gdk_device_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gint
x
,
gint
y
);
...
...
gdk/gdkdeviceprivate.h
View file @
a3cffa50
...
...
@@ -89,7 +89,6 @@ struct _GdkDeviceClass
GdkCursor
*
cursor
);
void
(
*
warp
)
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
);
void
(
*
query_state
)
(
GdkDevice
*
device
,
...
...
gdk/gdkwindow.c
View file @
a3cffa50
...
...
@@ -7358,7 +7358,7 @@ gdk_drag_begin_for_device (GdkWindow *window,
{
gint
x
,
y
;
gdk_device_get_position
(
device
,
NULL
,
&
x
,
&
y
);
gdk_device_get_position
(
device
,
&
x
,
&
y
);
return
gdk_drag_begin_from_point
(
window
,
device
,
targets
,
x
,
y
);
}
...
...
gdk/mir/gdkmirkeyboard.c
View file @
a3cffa50
...
...
@@ -84,7 +84,6 @@ gdk_mir_keyboard_set_window_cursor (GdkDevice *device,
static
void
gdk_mir_keyboard_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
...
...
gdk/mir/gdkmirpointer.c
View file @
a3cffa50
...
...
@@ -123,7 +123,6 @@ gdk_mir_pointer_set_window_cursor (GdkDevice *device,
static
void
gdk_mir_pointer_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
...
...
gdk/quartz/gdkdevice-core-quartz.c
View file @
a3cffa50
...
...
@@ -51,7 +51,6 @@ static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device,
GdkWindow
*
window
,
GdkCursor
*
cursor
);
static
void
gdk_quartz_device_core_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
);
static
void
gdk_quartz_device_core_query_state
(
GdkDevice
*
device
,
...
...
gdk/wayland/gdkdevice-wayland.c
View file @
a3cffa50
...
...
@@ -525,7 +525,6 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
static
void
gdk_wayland_device_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
...
...
gdk/win32/gdkdevice-virtual.c
View file @
a3cffa50
...
...
@@ -123,7 +123,6 @@ gdk_device_virtual_set_window_cursor (GdkDevice *device,
static
void
gdk_device_virtual_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
...
...
gdk/win32/gdkdevice-win32.c
View file @
a3cffa50
...
...
@@ -65,7 +65,6 @@ gdk_device_win32_set_window_cursor (GdkDevice *device,
static
void
gdk_device_win32_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
...
...
gdk/win32/gdkdevice-wintab.c
View file @
a3cffa50
...
...
@@ -100,7 +100,6 @@ gdk_device_wintab_set_window_cursor (GdkDevice *device,
static
void
gdk_device_wintab_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
...
...
gdk/win32/gdkwindow-win32.c
View file @
a3cffa50
...
...
@@ -2223,16 +2223,14 @@ gdk_window_win32_get_device_state (GdkWindow *window,
void
gdk_display_warp_device
(
GdkDisplay
*
display
,
GdkDevice
*
device
,
GdkScreen
*
screen
,
gint
x
,
gint
y
)
{
g_return_if_fail
(
display
==
gdk_display_get_default
());
g_return_if_fail
(
screen
==
gdk_display_get_default_screen
(
display
));
g_return_if_fail
(
GDK_IS_DEVICE
(
device
));
g_return_if_fail
(
display
==
gdk_device_get_display
(
device
));
GDK_DEVICE_GET_CLASS
(
device
)
->
warp
(
device
,
screen
,
x
,
y
);
GDK_DEVICE_GET_CLASS
(
device
)
->
warp
(
device
,
x
,
y
);
}
static
GdkEventMask
...
...
@@ -4471,8 +4469,7 @@ setup_drag_move_resize_context (GdkWindow *window,
* the titlebar is, if any.
*/
root_y
=
wy
+
wheight
/
2
;
gdk_device_warp
(
device
,
screen
,
root_x
,
root_y
);
gdk_device_warp
(
device
,
root_x
,
root_y
);
}
}
...
...
gdk/x11/gdkdevice-core-x11.c
View file @
a3cffa50
...
...
@@ -55,7 +55,6 @@ static void gdk_x11_device_core_set_window_cursor (GdkDevice *device,
GdkWindow
*
window
,
GdkCursor
*
cursor
);
static
void
gdk_x11_device_core_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
);
static
void
gdk_x11_device_core_query_state
(
GdkDevice
*
device
,
...
...
@@ -231,14 +230,15 @@ gdk_x11_device_core_set_window_cursor (GdkDevice *device,
static
void
gdk_x11_device_core_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
Display
*
xdisplay
;
Window
dest
;
GdkScreen
*
screen
;
xdisplay
=
GDK_DISPLAY_XDISPLAY
(
gdk_device_get_display
(
device
));
screen
=
gdk_display_get_default_screen
(
gdk_device_get_display
(
device
));
dest
=
GDK_WINDOW_XID
(
gdk_screen_get_root_window
(
screen
));
XWarpPointer
(
xdisplay
,
None
,
dest
,
0
,
0
,
0
,
0
,
...
...
gdk/x11/gdkdevice-xi2.c
View file @
a3cffa50
...
...
@@ -80,7 +80,6 @@ static void gdk_x11_device_xi2_set_window_cursor (GdkDevice *device,
GdkWindow
*
window
,
GdkCursor
*
cursor
);
static
void
gdk_x11_device_xi2_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
);
static
void
gdk_x11_device_xi2_query_state
(
GdkDevice
*
device
,
...
...
@@ -300,12 +299,12 @@ gdk_x11_device_xi2_set_window_cursor (GdkDevice *device,
static
void
gdk_x11_device_xi2_warp
(
GdkDevice
*
device
,
GdkScreen
*
screen
,
gdouble
x
,
gdouble
y
)
{
GdkX11DeviceXI2
*
device_xi2
=
GDK_X11_DEVICE_XI2
(
device
);
Window
dest
;
GdkScreen
*
screen
=
gdk_screen_get_default
();
dest
=
GDK_WINDOW_XID
(
gdk_screen_get_root_window
(
screen
));
...
...
gdk/x11/gdkdnd-x11.c
View file @
a3cffa50
...
...
@@ -3037,9 +3037,7 @@ gdk_dnd_handle_key_event (GdkDragContext *context,
{
x11_context
->
last_x
+=
dx
;
x11_context
->
last_y
+=
dy
;
gdk_device_warp
(
pointer
,
gdk_window_get_screen
(
x11_context
->
ipc_window
),
x11_context
->
last_x
,
x11_context
->
last_y
);
gdk_device_warp
(
pointer
,
x11_context
->
last_x
,
x11_context
->
last_y
);
}
gdk_drag_update
(
context
,
x11_context
->
last_x
,
x11_context
->
last_y
,
state
,
...
...
gtk/gtkdnd.c
View file @
a3cffa50
...
...
@@ -1311,7 +1311,7 @@ gtk_drag_begin_internal (GtkWidget *widget,
start_y
=
(
int
)
y
;
}
else
gdk_device_get_position
(
pointer
,
NULL
,
&
start_x
,
&
start_y
);
gdk_device_get_position
(
pointer
,
&
start_x
,
&
start_y
);
context
=
gdk_drag_begin_from_point
(
ipc_window
,
pointer
,
targets
,
start_x
,
start_y
);
...
...
@@ -1347,10 +1347,7 @@ gtk_drag_begin_internal (GtkWidget *widget,
info
->
icon_widget
=
NULL
;
info
->
destroy_icon
=
FALSE
;
if
(
event
)
info
->
cur_screen
=
gdk_display_get_default_screen
(
gdk_event_get_display
(
event
));
else
gdk_device_get_position
(
pointer
,
&
info
->
cur_screen
,
NULL
,
NULL
);
info
->
cur_screen
=
gdk_display_get_default_screen
(
gdk_event_get_display
(
event
));
info
->
start_x
=
start_x
;
info
->
start_y
=
start_y
;
...
...
gtk/gtkmenu.c
View file @
a3cffa50
...
...
@@ -3799,7 +3799,7 @@ gtk_menu_position_legacy (GtkMenu *menu,
display
=
gtk_widget_get_display
(
widget
);
pointer
=
_gtk_menu_shell_get_grab_device
(
GTK_MENU_SHELL
(
menu
));
gdk_device_get_position
(
pointer
,
NULL
,
&
x
,
&
y
);
gdk_device_get_position
(
pointer
,
&
x
,
&
y
);
/* Realize so we have the proper width and height to figure out
* the right place to popup the menu.
...
...
gtk/gtknotebook.c
View file @
a3cffa50
...
...
@@ -2974,8 +2974,7 @@ gtk_notebook_drag_end (GtkWidget *widget,
GtkNotebook
*
dest_notebook
=
NULL
;
gint
x
,
y
;
gdk_device_get_position
(
gdk_drag_context_get_device
(
context
),
NULL
,
&
x
,
&
y
);
gdk_device_get_position
(
gdk_drag_context_get_device
(
context
),
&
x
,
&
y
);
g_signal_emit
(
notebook
,
notebook_signals
[
CREATE_WINDOW
],
0
,
priv
->
detached_tab
->
child
,
x
,
y
,
&
dest_notebook
);
...
...
@@ -3024,8 +3023,7 @@ gtk_notebook_drag_failed (GtkWidget *widget,
GtkNotebook
*
dest_notebook
=
NULL
;
gint
x
,
y
;
gdk_device_get_position
(
gdk_drag_context_get_device
(
context
),
NULL
,
&
x
,
&
y
);
gdk_device_get_position
(
gdk_drag_context_get_device
(
context
),
&
x
,
&
y
);
g_signal_emit
(
notebook
,
notebook_signals
[
CREATE_WINDOW
],
0
,
priv
->
detached_tab
->
child
,
x
,
y
,
&
dest_notebook
);
...
...
gtk/gtkwidget.c
View file @
a3cffa50
...
...
@@ -10518,7 +10518,6 @@ synth_crossing (GtkWidget *widget,
event
->
crossing
.
subwindow
=
g_object_ref
(
window
);
event
->
crossing
.
time
=
GDK_CURRENT_TIME
;
gdk_device_get_position_double
(
device
,
NULL
,
&
event
->
crossing
.
x_root
,
&
event
->
crossing
.
y_root
);
gdk_window_get_device_position_double
(
window
,
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment