Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dorota Czaplejewicz
gtk
Commits
113d2180
Commit
113d2180
authored
Sep 08, 2009
by
Alexander Larsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of window cursor wrt grabs
Even for grabs we need to recurse up to look for what cursor to use.
parent
4e78b4c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
gdk/gdkwindow.c
gdk/gdkwindow.c
+19
-11
No files found.
gdk/gdkwindow.c
View file @
113d2180
...
...
@@ -8599,28 +8599,36 @@ _gdk_window_event_parent_of (GdkWindow *parent,
static
void
update_cursor
(
GdkDisplay
*
display
)
{
GdkWindowObject
*
pointer_window
,
*
cursor_window
,
*
parent
,
*
toplevel
;
GdkWindowObject
*
cursor_window
,
*
parent
,
*
toplevel
;
GdkWindow
*
pointer_window
;
GdkWindowImplIface
*
impl_iface
;
GdkPointerGrabInfo
*
grab
;
pointer_window
=
(
GdkWindowObject
*
)
display
->
pointer_info
.
window_under_pointer
;
cursor_window
=
pointer_window
;
while
(
cursor_window
->
cursor
==
NULL
&&
(
parent
=
get_event_parent
(
cursor_window
))
!=
NULL
&&
parent
->
window_type
!=
GDK_WINDOW_ROOT
)
cursor_window
=
parent
;
pointer_window
=
display
->
pointer_info
.
window_under_pointer
;
/* We ignore the serials here and just pick the last grab
we've sent, as that would shortly be used anyway. */
grab
=
_gdk_display_get_last_pointer_grab
(
display
);
if
(
grab
!=
NULL
&&
!
_gdk_window_event_parent_of
(
grab
->
window
,
(
GdkWindow
*
)
cursor_window
))
if
(
/* have grab */
grab
!=
NULL
&&
/* the pointer is not in a descendant of the grab window */
!
_gdk_window_event_parent_of
(
grab
->
window
,
pointer_window
))
/* use the cursor from the grab window */
cursor_window
=
(
GdkWindowObject
*
)
grab
->
window
;
else
/* otherwise use the cursor from the pointer window */
cursor_window
=
(
GdkWindowObject
*
)
pointer_window
;
/* Find the first window with the cursor actually set, as
the cursor is inherited from the parent */
while
(
cursor_window
->
cursor
==
NULL
&&
(
parent
=
get_event_parent
(
cursor_window
))
!=
NULL
&&
parent
->
window_type
!=
GDK_WINDOW_ROOT
)
cursor_window
=
parent
;
/* Set all cursors on toplevel, otherwise its tricky to keep track of
* which native window has what cursor set. */
toplevel
=
(
GdkWindowObject
*
)
get_event_toplevel
(
(
GdkWindow
*
)
pointer_window
);
toplevel
=
(
GdkWindowObject
*
)
get_event_toplevel
(
pointer_window
);
impl_iface
=
GDK_WINDOW_IMPL_GET_IFACE
(
toplevel
->
impl
);
impl_iface
->
set_cursor
((
GdkWindow
*
)
toplevel
,
cursor_window
->
cursor
);
}
...
...
Write
Preview
Markdown
is supported
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