From 4730cb57bd9b07ccb5629f411e6caca8aa0f2b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Mon, 10 Apr 2006 08:30:02 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 12 ++++++++++++ src/display.c | 54 --------------------------------------------------- src/display.h | 7 ------- src/ui.c | 14 ------------- src/ui.h | 1 - 5 files changed, 12 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84fc1c62d..a1a7fcec5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-04-10 Björn Lindqvist + + * display.c (meta_display_open, event_callback): + * ui.c (meta_ui_get_double_click_timeout): + + Delete dead code that used to handle double click on the + titlebar. Remove the attributes last_button_time, + last_button_xwindow, last_button_num and is_double_click from + MetaDisplay and the functions meta_ui_get_double_click_timeout() + and meta_display_is_double_click() from their respective + files. Fixes #337507. + 2006-03-27 Gora Mohanty * src/metacity.schemas.in: diff --git a/src/display.c b/src/display.c index a4e5253bf..0b2b05fcc 100644 --- a/src/display.c +++ b/src/display.c @@ -538,11 +538,6 @@ meta_display_open (const char *name) display->window_ids = g_hash_table_new (meta_unsigned_long_hash, meta_unsigned_long_equal); - display->last_button_time = 0; - display->last_button_xwindow = None; - display->last_button_num = 0; - display->is_double_click = FALSE; - i = 0; while (i < N_IGNORED_SERIALS) { @@ -1057,12 +1052,6 @@ meta_displays_list (void) return all_displays; } -gboolean -meta_display_is_double_click (MetaDisplay *display) -{ - return display->is_double_click; -} - static gboolean dump_events = TRUE; #ifndef USE_GDK_DISPLAY @@ -1345,28 +1334,6 @@ meta_display_queue_autoraise_callback (MetaDisplay *display, display->autoraise_window = window; } -static int -double_click_timeout_for_event (MetaDisplay *display, - XEvent *event) -{ - MetaScreen *screen; - - g_assert (event->type == ButtonPress || - event->type == ButtonRelease); - - screen = meta_display_screen_for_root (display, - event->xbutton.root); - if (screen == NULL) - { - /* Odd, we aren't managing this screen */ - meta_warning ("Received button event on root 0x%lx we aren't managing\n", - event->xbutton.root); - return 250; /* make up number */ - } - - return meta_ui_get_double_click_timeout (screen->ui); -} - #if 0 static void handle_net_moveresize_window (MetaDisplay* display, @@ -1510,27 +1477,6 @@ event_callback (XEvent *event, if (event->xbutton.button == 4 || event->xbutton.button == 5) return FALSE; - - /* mark double click events, kind of a hack, oh well. */ - if (((int)event->xbutton.button) == display->last_button_num && - event->xbutton.window == display->last_button_xwindow && - event->xbutton.time < (display->last_button_time + - double_click_timeout_for_event (display, - event))) - { - display->is_double_click = TRUE; - meta_topic (META_DEBUG_EVENTS, - "This was the second click of a double click\n"); - - } - else - { - display->is_double_click = FALSE; - } - - display->last_button_num = event->xbutton.button; - display->last_button_xwindow = event->xbutton.window; - display->last_button_time = event->xbutton.time; } else if (event->type == UnmapNotify) { diff --git a/src/display.h b/src/display.h index 639d7a645..63a9a2aba 100644 --- a/src/display.h +++ b/src/display.h @@ -225,12 +225,6 @@ struct _MetaDisplay XErrorEvent *error); int server_grab_count; - /* for double click */ - Time last_button_time; - Window last_button_xwindow; - int last_button_num; - guint is_double_click : 1; - /* serials of leave/unmap events that may * correspond to an enter event we should * ignore @@ -402,7 +396,6 @@ MetaScreen* meta_display_screen_for_xwindow (MetaDisplay *display, Window xindow); void meta_display_grab (MetaDisplay *display); void meta_display_ungrab (MetaDisplay *display); -gboolean meta_display_is_double_click (MetaDisplay *display); void meta_display_unmanage_screen (MetaDisplay *display, MetaScreen *screen); diff --git a/src/ui.c b/src/ui.c index 3f10044cc..baeb28899 100644 --- a/src/ui.c +++ b/src/ui.c @@ -930,20 +930,6 @@ meta_stock_icons_init (void) g_object_unref (G_OBJECT (factory)); } -int -meta_ui_get_double_click_timeout (MetaUI *ui) -{ - GtkSettings *settings; - int timeout; - - settings = gtk_widget_get_settings (GTK_WIDGET (ui->frames)); - - timeout = 250; - g_object_get (G_OBJECT (settings), "gtk-double-click-time", &timeout, NULL); - - return timeout; -} - int meta_ui_get_drag_threshold (MetaUI *ui) { diff --git a/src/ui.h b/src/ui.h index e2a1833a0..a677482cf 100644 --- a/src/ui.h +++ b/src/ui.h @@ -191,7 +191,6 @@ gchar* meta_ui_accelerator_name (unsigned int keysym, gboolean meta_ui_window_is_widget (MetaUI *ui, Window xwindow); -int meta_ui_get_double_click_timeout (MetaUI *ui); int meta_ui_get_drag_threshold (MetaUI *ui); #include "tabpopup.h"