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

Side by Side Diff: chrome/browser/ui/gtk/gtk_util.cc

Issue 9109028: GTK: Another GTK deprecation patch. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: evanm fix Created 8 years, 11 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 | « chrome/browser/ui/gtk/gtk_custom_menu_item.cc ('k') | chrome/browser/ui/gtk/menu_gtk.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/gtk/gtk_util.h" 5 #include "chrome/browser/ui/gtk/gtk_util.h"
6 6
7 #include <cairo/cairo.h> 7 #include <cairo/cairo.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cstdarg> 10 #include <cstdarg>
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 gdk_event_free(event); 838 gdk_event_free(event);
839 return event_utils::DispositionFromGdkState(state); 839 return event_utils::DispositionFromGdkState(state);
840 } 840 }
841 841
842 bool GrabAllInput(GtkWidget* widget) { 842 bool GrabAllInput(GtkWidget* widget) {
843 guint time = gtk_get_current_event_time(); 843 guint time = gtk_get_current_event_time();
844 844
845 if (!gtk_widget_get_visible(widget)) 845 if (!gtk_widget_get_visible(widget))
846 return false; 846 return false;
847 847
848 if (!gdk_pointer_grab(widget->window, TRUE, 848 GdkWindow* gdk_window = gtk_widget_get_window(widget);
849 if (!gdk_pointer_grab(gdk_window,
850 TRUE,
849 GdkEventMask(GDK_BUTTON_PRESS_MASK | 851 GdkEventMask(GDK_BUTTON_PRESS_MASK |
850 GDK_BUTTON_RELEASE_MASK | 852 GDK_BUTTON_RELEASE_MASK |
851 GDK_ENTER_NOTIFY_MASK | 853 GDK_ENTER_NOTIFY_MASK |
852 GDK_LEAVE_NOTIFY_MASK | 854 GDK_LEAVE_NOTIFY_MASK |
853 GDK_POINTER_MOTION_MASK), 855 GDK_POINTER_MOTION_MASK),
854 NULL, NULL, time) == 0) { 856 NULL, NULL, time) == 0) {
855 return false; 857 return false;
856 } 858 }
857 859
858 if (!gdk_keyboard_grab(widget->window, TRUE, time) == 0) { 860 if (!gdk_keyboard_grab(gdk_window, TRUE, time) == 0) {
859 gdk_display_pointer_ungrab(gdk_drawable_get_display(widget->window), time); 861 gdk_display_pointer_ungrab(gdk_drawable_get_display(gdk_window), time);
860 return false; 862 return false;
861 } 863 }
862 864
863 gtk_grab_add(widget); 865 gtk_grab_add(widget);
864 return true; 866 return true;
865 } 867 }
866 868
867 gfx::Rect WidgetBounds(GtkWidget* widget) { 869 gfx::Rect WidgetBounds(GtkWidget* widget) {
868 // To quote the gtk docs: 870 // To quote the gtk docs:
869 // 871 //
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 1173
1172 void DoCopy(BrowserWindow* window) { 1174 void DoCopy(BrowserWindow* window) {
1173 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard"); 1175 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard");
1174 } 1176 }
1175 1177
1176 void DoPaste(BrowserWindow* window) { 1178 void DoPaste(BrowserWindow* window) {
1177 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard"); 1179 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard");
1178 } 1180 }
1179 1181
1180 } // namespace gtk_util 1182 } // namespace gtk_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_custom_menu_item.cc ('k') | chrome/browser/ui/gtk/menu_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698