| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 if (frame_cursor_) { | 576 if (frame_cursor_) { |
| 577 gdk_cursor_unref(frame_cursor_); | 577 gdk_cursor_unref(frame_cursor_); |
| 578 frame_cursor_ = NULL; | 578 frame_cursor_ = NULL; |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 | 581 |
| 582 void BrowserWindowGtk::HandleKeyboardEvent(GdkEventKey* event) { | 582 void BrowserWindowGtk::HandleKeyboardEvent(GdkEventKey* event) { |
| 583 // Handles a key event in following sequence: | 583 // Handles a key event in following sequence: |
| 584 // 1. Our special key accelerators, such as ctrl-tab, etc. | 584 // 1. Our special key accelerators, such as ctrl-tab, etc. |
| 585 // 2. Gtk mnemonics and accelerators. | 585 // 2. Gtk mnemonics and accelerators. |
| 586 // 3. Gtk binding set. | |
| 587 // This sequence matches the default key press handler of GtkWindow. | 586 // This sequence matches the default key press handler of GtkWindow. |
| 588 // | 587 // |
| 589 // It's not necessary to care about the keyboard layout issue, as | 588 // It's not necessary to care about the keyboard layout, as |
| 590 // gtk_window_activate_key() and gtk_bindings_activate_event() take care of it | 589 // gtk_window_activate_key() takes care of it automatically. |
| 591 // automatically. | |
| 592 if (!HandleCustomAccelerator(event->keyval, GdkModifierType(event->state), | 590 if (!HandleCustomAccelerator(event->keyval, GdkModifierType(event->state), |
| 593 browser_.get())) { | 591 browser_.get())) { |
| 594 if (!gtk_window_activate_key(window_, event)) { | 592 gtk_window_activate_key(window_, event); |
| 595 gtk_bindings_activate_event(GTK_OBJECT(window_), event); | |
| 596 } | |
| 597 } | 593 } |
| 598 } | 594 } |
| 599 | 595 |
| 600 gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget, | 596 gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget, |
| 601 GdkEventExpose* event, | 597 GdkEventExpose* event, |
| 602 BrowserWindowGtk* window) { | 598 BrowserWindowGtk* window) { |
| 603 ThemeProvider* theme_provider = | 599 ThemeProvider* theme_provider = |
| 604 window->browser()->profile()->GetThemeProvider(); | 600 window->browser()->profile()->GetThemeProvider(); |
| 605 | 601 |
| 606 // Draw the default background. | 602 // Draw the default background. |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 // special-case the ones where the custom frame should be used. These names | 2156 // special-case the ones where the custom frame should be used. These names |
| 2161 // are taken from the WMs' source code. | 2157 // are taken from the WMs' source code. |
| 2162 return (wm_name == "Blackbox" || | 2158 return (wm_name == "Blackbox" || |
| 2163 wm_name == "compiz" || | 2159 wm_name == "compiz" || |
| 2164 wm_name == "e16" || // Enlightenment DR16 | 2160 wm_name == "e16" || // Enlightenment DR16 |
| 2165 wm_name == "KWin" || | 2161 wm_name == "KWin" || |
| 2166 wm_name == "Metacity" || | 2162 wm_name == "Metacity" || |
| 2167 wm_name == "Openbox" || | 2163 wm_name == "Openbox" || |
| 2168 wm_name == "Xfwm4"); | 2164 wm_name == "Xfwm4"); |
| 2169 } | 2165 } |
| OLD | NEW |