From 6f318f1a751bfb6e0d77ff2f9794602d2d70b1e6 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Fri, 20 Jan 2006 23:02:24 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20unitialized=20value=20problem=20when=20in?= =?UTF-8?q?=20raise-on-click=20mode.=20S=C3=B8ren,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-01-20 Elijah Newren Fix unitialized value problem when in raise-on-click mode. Søren, #327572. * src/display.c (meta_display_check_threshold_reached): make function be a no op if raise_on_click!=FALSE * src/display.h (struct MetaDisplay): point out that grab_initial_[xy] and grab_threshold_movement_reached are only for raise_on_click==FALSE mode. --- ChangeLog | 12 ++++++++++++ src/display.c | 3 ++- src/display.h | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 072ce0a4d..f98b0b1e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-01-20 Elijah Newren + + Fix unitialized value problem when in raise-on-click mode. Søren, + #327572. + + * src/display.c (meta_display_check_threshold_reached): make + function be a no op if raise_on_click!=FALSE + + * src/display.h (struct MetaDisplay): point out that + grab_initial_[xy] and grab_threshold_movement_reached are only for + raise_on_click==FALSE mode. + 2006-01-20 Elijah Newren Patch from Søren to fix some reading-from-free'd-data errors. diff --git a/src/display.c b/src/display.c index aa602f2a5..0c1a6e361 100644 --- a/src/display.c +++ b/src/display.c @@ -3616,7 +3616,8 @@ meta_display_check_threshold_reached (MetaDisplay *display, int y) { /* Don't bother doing the check again if we've already reached the threshold */ - if (display->grab_threshold_movement_reached) + if (display->grab_threshold_movement_reached || + meta_prefs_get_raise_on_click ()) return; if (ABS (display->grab_initial_x - x) >= 8 || diff --git a/src/display.h b/src/display.h index 54e5c901e..ca74f19c7 100644 --- a/src/display.h +++ b/src/display.h @@ -269,8 +269,8 @@ struct _MetaDisplay MetaRectangle grab_wireframe_rect; MetaRectangle grab_wireframe_last_xor_rect; MetaRectangle grab_initial_window_pos; - int grab_initial_x, grab_initial_y; - gboolean grab_threshold_movement_reached; + int grab_initial_x, grab_initial_y; /* These are only relevant for */ + gboolean grab_threshold_movement_reached; /* raise_on_click == FALSE. */ MetaResizePopup *grab_resize_popup; GTimeVal grab_last_moveresize_time; Time grab_motion_notify_time;