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

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

Issue 195071: GTK: Cache our GdkCursor objects, since building them hits the disk. (Closed)
Patch Set: Put in gtk_util Created 11 years, 3 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 | chrome/browser/gtk/gtk_chrome_link_button.cc » ('j') | chrome/common/gtk_util.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 GdkCursorType last_cursor = GDK_LAST_CURSOR; 1870 GdkCursorType last_cursor = GDK_LAST_CURSOR;
1871 if (browser->frame_cursor_) 1871 if (browser->frame_cursor_)
1872 last_cursor = browser->frame_cursor_->type; 1872 last_cursor = browser->frame_cursor_->type;
1873 1873
1874 if (last_cursor != new_cursor) { 1874 if (last_cursor != new_cursor) {
1875 if (browser->frame_cursor_) { 1875 if (browser->frame_cursor_) {
1876 gdk_cursor_unref(browser->frame_cursor_); 1876 gdk_cursor_unref(browser->frame_cursor_);
1877 browser->frame_cursor_ = NULL; 1877 browser->frame_cursor_ = NULL;
1878 } 1878 }
1879 if (has_hit_edge) { 1879 if (has_hit_edge) {
1880 browser->frame_cursor_ = gdk_cursor_new(new_cursor); 1880 browser->frame_cursor_ = gtk_util::GetCursor(new_cursor);
1881 gdk_window_set_cursor(GTK_WIDGET(browser->window_)->window, 1881 gdk_window_set_cursor(GTK_WIDGET(browser->window_)->window,
1882 browser->frame_cursor_); 1882 browser->frame_cursor_);
1883 } else { 1883 } else {
1884 gdk_window_set_cursor(GTK_WIDGET(browser->window_)->window, NULL); 1884 gdk_window_set_cursor(GTK_WIDGET(browser->window_)->window, NULL);
1885 } 1885 }
1886 } 1886 }
1887 return FALSE; 1887 return FALSE;
1888 } 1888 }
1889 1889
1890 // static 1890 // static
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 // special-case the ones where the custom frame should be used. These names 2167 // special-case the ones where the custom frame should be used. These names
2168 // are taken from the WMs' source code. 2168 // are taken from the WMs' source code.
2169 return (wm_name == "Blackbox" || 2169 return (wm_name == "Blackbox" ||
2170 wm_name == "compiz" || 2170 wm_name == "compiz" ||
2171 wm_name == "e16" || // Enlightenment DR16 2171 wm_name == "e16" || // Enlightenment DR16
2172 wm_name == "KWin" || 2172 wm_name == "KWin" ||
2173 wm_name == "Metacity" || 2173 wm_name == "Metacity" ||
2174 wm_name == "Openbox" || 2174 wm_name == "Openbox" ||
2175 wm_name == "Xfwm4"); 2175 wm_name == "Xfwm4");
2176 } 2176 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/gtk_chrome_link_button.cc » ('j') | chrome/common/gtk_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698