OLD | NEW |
---|---|
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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
586 ActiveWindowWatcherX::RemoveObserver(this); | 586 ActiveWindowWatcherX::RemoveObserver(this); |
587 | 587 |
588 browser_->tabstrip_model()->RemoveObserver(this); | 588 browser_->tabstrip_model()->RemoveObserver(this); |
589 | 589 |
590 if (frame_cursor_) { | 590 if (frame_cursor_) { |
591 gdk_cursor_unref(frame_cursor_); | 591 gdk_cursor_unref(frame_cursor_); |
592 frame_cursor_ = NULL; | 592 frame_cursor_ = NULL; |
593 } | 593 } |
594 } | 594 } |
595 | 595 |
596 void BrowserWindowGtk::HandleKeyboardEvent(GdkEventKey* event) { | 596 bool BrowserWindowGtk::HandleKeyboardEvent(GdkEventKey* event) { |
597 // Handles a key event in following sequence: | 597 // Handles a key event in following sequence: |
598 // 1. Our special key accelerators, such as ctrl-tab, etc. | 598 // 1. Our special key accelerators, such as ctrl-tab, etc. |
599 // 2. Gtk mnemonics and accelerators. | 599 // 2. Gtk mnemonics and accelerators. |
600 // This sequence matches the default key press handler of GtkWindow. | 600 // This sequence matches the default key press handler of GtkWindow. |
601 // | 601 // |
602 // It's not necessary to care about the keyboard layout, as | 602 // It's not necessary to care about the keyboard layout, as |
603 // gtk_window_activate_key() takes care of it automatically. | 603 // gtk_window_activate_key() takes care of it automatically. |
604 if (!HandleCustomAccelerator(event->keyval, GdkModifierType(event->state), | 604 if (!HandleCustomAccelerator(event->keyval, GdkModifierType(event->state), |
605 browser_.get())) { | 605 browser_.get())) { |
606 gtk_window_activate_key(window_, event); | 606 return gtk_window_activate_key(window_, event); |
607 } | 607 } |
608 return true; | |
Nico
2009/10/24 02:31:10
This would be easier to understand if it went like
James Su
2009/10/24 10:53:48
Good point. I'll change it in an upcoming CL.
On
| |
608 } | 609 } |
609 | 610 |
610 gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget, | 611 gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget, |
611 GdkEventExpose* event, | 612 GdkEventExpose* event, |
612 BrowserWindowGtk* window) { | 613 BrowserWindowGtk* window) { |
613 GtkThemeProvider* theme_provider = GtkThemeProvider::GetFrom( | 614 GtkThemeProvider* theme_provider = GtkThemeProvider::GetFrom( |
614 window->browser()->profile()); | 615 window->browser()->profile()); |
615 | 616 |
616 // Draw the default background. | 617 // Draw the default background. |
617 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); | 618 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); |
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2275 // are taken from the WMs' source code. | 2276 // are taken from the WMs' source code. |
2276 return (wm_name == "Blackbox" || | 2277 return (wm_name == "Blackbox" || |
2277 wm_name == "compiz" || | 2278 wm_name == "compiz" || |
2278 wm_name == "e16" || // Enlightenment DR16 | 2279 wm_name == "e16" || // Enlightenment DR16 |
2279 wm_name == "KWin" || | 2280 wm_name == "KWin" || |
2280 wm_name == "Metacity" || | 2281 wm_name == "Metacity" || |
2281 wm_name == "Mutter" || | 2282 wm_name == "Mutter" || |
2282 wm_name == "Openbox" || | 2283 wm_name == "Openbox" || |
2283 wm_name == "Xfwm4"); | 2284 wm_name == "Xfwm4"); |
2284 } | 2285 } |
OLD | NEW |