From 1169e104cb2b0fa06bb7f1e36c4cc3a0cbe441aa Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Tue, 15 Apr 2014 19:52:52 +0200 Subject: [PATCH] events: Bypass both gtk+ and the compositor for SelectionClear We can't do any further processing after this since we have already freed most of our structures including the MetaDisplay. --- src/core/events.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/core/events.c b/src/core/events.c index d013d5667..fef8616d3 100644 --- a/src/core/events.c +++ b/src/core/events.c @@ -1530,21 +1530,6 @@ handle_other_xevent (MetaDisplay *display, } } break; - case SelectionClear: - /* do this here instead of at end of function - * so we can return - */ - - /* FIXME: Clearing display->current_time here makes no sense to - * me; who put this here and why? - */ - display->current_time = CurrentTime; - - process_selection_clear (display, event); - /* Note that processing that may have resulted in - * closing the display... so return right away. - */ - return FALSE; case SelectionRequest: process_selection_request (display, event); break; @@ -1866,6 +1851,17 @@ meta_display_handle_xevent (MetaDisplay *display, goto out; } + if (event->type == SelectionClear) + { + /* Do this here so we can return without any further + * processing. */ + process_selection_clear (display, event); + /* Note that processing that may have resulted in + * closing the display... */ + bypass_gtk = bypass_compositor = TRUE; + goto out; + } + out: if (!bypass_compositor) {