diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 05:14:38 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 05:14:38 +0000 |
commit | f98f581eb3999563a71e8cf35c68420951c9f4e1 (patch) | |
tree | cf433187433c328f7c8c8326adfbaba67076bbf7 /chrome/browser/gtk | |
parent | c990ac88c6bf045438c5ec9b265d08aeea0dd654 (diff) | |
download | chromium_src-f98f581eb3999563a71e8cf35c68420951c9f4e1.zip chromium_src-f98f581eb3999563a71e8cf35c68420951c9f4e1.tar.gz chromium_src-f98f581eb3999563a71e8cf35c68420951c9f4e1.tar.bz2 |
Ignore titlebar drags if the window is maximized and matches the screen
size. This is to work around a case that would normally fullscreen
the window.
BUG=23480
TEST=maximize chrome on a desktop w/o gnome panels and try to drag
the area behind the tabs. nothing should happen.
Review URL: http://codereview.chromium.org/651005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 9a0a4db..2f9e737 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1830,10 +1830,18 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget, if (click_time > static_cast<guint32>(double_click_time) || click_move_x > double_click_distance || click_move_y > double_click_distance) { - gtk_window_begin_move_drag(window->window_, event->button, - static_cast<gint>(event->x_root), - static_cast<gint>(event->y_root), - event->time); + // Ignore drag requests if the window is the size of the screen. + // We do this to avoid triggering fullscreen mode in metacity + // (without the --no-force-fullscreen flag) and in compiz (with + // Legacy Fullscreen Mode enabled). + GdkScreen* screen = gtk_window_get_screen(window->window_); + if (window->bounds_.width() != gdk_screen_get_width(screen) || + window->bounds_.height() != gdk_screen_get_height(screen)) { + gtk_window_begin_move_drag(window->window_, event->button, + static_cast<gint>(event->x_root), + static_cast<gint>(event->y_root), + event->time); + } return TRUE; } } else if (has_hit_edge) { |