Compare commits
2 Commits
citadel
...
wip/carlos
Author | SHA1 | Date | |
---|---|---|---|
|
2cf9249d2b | ||
|
f988a9caaa |
@ -127,6 +127,7 @@ struct _MetaX11Display
|
||||
|
||||
struct {
|
||||
Window xwindow;
|
||||
uint32_t ownership_timestamp;
|
||||
MetaSelectionSource *owners[META_N_SELECTION_TYPES];
|
||||
GCancellable *cancellables[META_N_SELECTION_TYPES];
|
||||
|
||||
|
@ -322,6 +322,7 @@ meta_x11_selection_handle_xfixes_selection_notify (MetaX11Display *x11_display,
|
||||
if (!atom_to_selection_type (xdisplay, event->selection, &selection_type))
|
||||
return FALSE;
|
||||
|
||||
x11_display->selection.ownership_timestamp = event->selection_timestamp;
|
||||
selection = meta_display_get_selection (meta_get_display ());
|
||||
|
||||
if (x11_display->selection.cancellables[selection_type])
|
||||
@ -339,6 +340,7 @@ meta_x11_selection_handle_xfixes_selection_notify (MetaX11Display *x11_display,
|
||||
/* An X client went away, clear the selection */
|
||||
meta_selection_unset_owner (selection, selection_type,
|
||||
x11_display->selection.owners[selection_type]);
|
||||
g_clear_object (&x11_display->selection.owners[selection_type]);
|
||||
}
|
||||
}
|
||||
else if (event->owner != x11_display->selection.xwindow)
|
||||
@ -359,6 +361,8 @@ meta_x11_selection_handle_xfixes_selection_notify (MetaX11Display *x11_display,
|
||||
data);
|
||||
}
|
||||
|
||||
x11_display->selection.ownership_timestamp = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -380,6 +384,7 @@ notify_selection_owner (MetaX11Display *x11_display,
|
||||
MetaSelectionSource *new_owner)
|
||||
{
|
||||
Display *xdisplay = x11_display->xdisplay;
|
||||
uint32_t timestamp;
|
||||
|
||||
if (new_owner && !META_IS_SELECTION_SOURCE_X11 (new_owner))
|
||||
{
|
||||
@ -389,13 +394,17 @@ notify_selection_owner (MetaX11Display *x11_display,
|
||||
g_clear_object (&x11_display->selection.cancellables[selection_type]);
|
||||
}
|
||||
|
||||
timestamp = x11_display->selection.ownership_timestamp ?
|
||||
x11_display->selection.ownership_timestamp :
|
||||
meta_display_get_current_time (x11_display->display);
|
||||
|
||||
/* If the owner is non-X11, claim the selection on our selection
|
||||
* window, so X11 apps can interface with it.
|
||||
*/
|
||||
XSetSelectionOwner (xdisplay,
|
||||
selection_to_atom (selection_type, xdisplay),
|
||||
x11_display->selection.xwindow,
|
||||
META_CURRENT_TIME);
|
||||
timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user