Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 3061023: GTK: Fix some event coordinate logic (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gtk/browser_window_gtk.h" 5 #include "chrome/browser/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 // we don't call gtk_window_begin_move_drag. 1905 // we don't call gtk_window_begin_move_drag.
1906 static GtkSettings* settings = gtk_settings_get_default(); 1906 static GtkSettings* settings = gtk_settings_get_default();
1907 gint double_click_time = 250; 1907 gint double_click_time = 250;
1908 gint double_click_distance = 5; 1908 gint double_click_distance = 5;
1909 g_object_get(G_OBJECT(settings), 1909 g_object_get(G_OBJECT(settings),
1910 "gtk-double-click-time", &double_click_time, 1910 "gtk-double-click-time", &double_click_time,
1911 "gtk-double-click-distance", &double_click_distance, 1911 "gtk-double-click-distance", &double_click_distance,
1912 NULL); 1912 NULL);
1913 1913
1914 guint32 click_time = event->time - last_click_time; 1914 guint32 click_time = event->time - last_click_time;
1915 int click_move_x = static_cast<int>(event->x - last_click_position.x()); 1915 int click_move_x = abs(event->x - last_click_position.x());
1916 int click_move_y = static_cast<int>(event->y - last_click_position.y()); 1916 int click_move_y = abs(event->y - last_click_position.y());
1917 1917
1918 if (click_time > static_cast<guint32>(double_click_time) || 1918 if (click_time > static_cast<guint32>(double_click_time) ||
1919 click_move_x > double_click_distance || 1919 click_move_x > double_click_distance ||
1920 click_move_y > double_click_distance) { 1920 click_move_y > double_click_distance) {
1921 // Ignore drag requests if the window is the size of the screen. 1921 // Ignore drag requests if the window is the size of the screen.
1922 // We do this to avoid triggering fullscreen mode in metacity 1922 // We do this to avoid triggering fullscreen mode in metacity
1923 // (without the --no-force-fullscreen flag) and in compiz (with 1923 // (without the --no-force-fullscreen flag) and in compiz (with
1924 // Legacy Fullscreen Mode enabled). 1924 // Legacy Fullscreen Mode enabled).
1925 GdkScreen* screen = gtk_window_get_screen(window_); 1925 GdkScreen* screen = gtk_window_get_screen(window_);
1926 if (bounds_.width() != gdk_screen_get_width(screen) || 1926 if (bounds_.width() != gdk_screen_get_width(screen) ||
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2141 // special-case the ones where the custom frame should be used. These names 2141 // special-case the ones where the custom frame should be used. These names
2142 // are taken from the WMs' source code. 2142 // are taken from the WMs' source code.
2143 return (wm_name == "Blackbox" || 2143 return (wm_name == "Blackbox" ||
2144 wm_name == "compiz" || 2144 wm_name == "compiz" ||
2145 wm_name == "e16" || // Enlightenment DR16 2145 wm_name == "e16" || // Enlightenment DR16
2146 wm_name == "Metacity" || 2146 wm_name == "Metacity" ||
2147 wm_name == "Mutter" || 2147 wm_name == "Mutter" ||
2148 wm_name == "Openbox" || 2148 wm_name == "Openbox" ||
2149 wm_name == "Xfwm4"); 2149 wm_name == "Xfwm4");
2150 } 2150 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698