Chromium Code Reviews| 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 "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1542 // TODO(jhawkins): Investigate the possibility of the button numbers being | 1542 // TODO(jhawkins): Investigate the possibility of the button numbers being |
| 1543 // different for other mice. | 1543 // different for other mice. |
| 1544 if (event->button == 8) { | 1544 if (event->button == 8) { |
| 1545 browser->browser_->GoBack(CURRENT_TAB); | 1545 browser->browser_->GoBack(CURRENT_TAB); |
| 1546 return TRUE; | 1546 return TRUE; |
| 1547 } else if (event->button == 9) { | 1547 } else if (event->button == 9) { |
| 1548 browser->browser_->GoForward(CURRENT_TAB); | 1548 browser->browser_->GoForward(CURRENT_TAB); |
| 1549 return TRUE; | 1549 return TRUE; |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 // Handle left and right clicks. In particular, we care about clicks in the | 1552 // Handle left, middle and right clicks. In particular, we care about clicks |
| 1553 // custom frame border and clicks in the titlebar. | 1553 // in the custom frame border and clicks in the titlebar. |
| 1554 GdkWindowEdge edge; | 1554 GdkWindowEdge edge; |
| 1555 bool has_hit_edge = browser->GetWindowEdge(static_cast<int>(event->x), | 1555 bool has_hit_edge = browser->GetWindowEdge(static_cast<int>(event->x), |
| 1556 static_cast<int>(event->y), &edge); | 1556 static_cast<int>(event->y), &edge); |
| 1557 // Ignore clicks that are in/below the browser toolbar. | 1557 // Ignore clicks that are in/below the browser toolbar. |
| 1558 GtkWidget* toolbar = browser->toolbar_->widget(); | 1558 GtkWidget* toolbar = browser->toolbar_->widget(); |
| 1559 if (!GTK_WIDGET_VISIBLE(toolbar)) { | 1559 if (!GTK_WIDGET_VISIBLE(toolbar)) { |
| 1560 // If the toolbar is not showing, use the location of web contents as the | 1560 // If the toolbar is not showing, use the location of web contents as the |
| 1561 // boundary of where to ignore clicks. | 1561 // boundary of where to ignore clicks. |
| 1562 toolbar = browser->render_area_vbox_; | 1562 toolbar = browser->render_area_vbox_; |
| 1563 } | 1563 } |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 1580 if (has_hit_titlebar) { | 1580 if (has_hit_titlebar) { |
| 1581 // Maximize/restore on double click. | 1581 // Maximize/restore on double click. |
| 1582 if (browser->IsMaximized()) { | 1582 if (browser->IsMaximized()) { |
| 1583 gtk_window_unmaximize(browser->window_); | 1583 gtk_window_unmaximize(browser->window_); |
| 1584 } else { | 1584 } else { |
| 1585 gtk_window_maximize(browser->window_); | 1585 gtk_window_maximize(browser->window_); |
| 1586 } | 1586 } |
| 1587 return TRUE; | 1587 return TRUE; |
| 1588 } | 1588 } |
| 1589 } | 1589 } |
| 1590 } else if (event->button == 2) { | |
| 1591 gdk_window_lower(GTK_WIDGET(browser->window_)->window); | |
|
CalebEgg_gmail.com
2009/08/07 09:09:38
Won't this need to be wrapped in if (has_hit_title
| |
| 1592 return TRUE; | |
| 1590 } else if (event->button == 3) { | 1593 } else if (event->button == 3) { |
| 1591 if (has_hit_titlebar) { | 1594 if (has_hit_titlebar) { |
| 1592 browser->titlebar_->ShowContextMenu(); | 1595 browser->titlebar_->ShowContextMenu(); |
| 1593 return TRUE; | 1596 return TRUE; |
| 1594 } | 1597 } |
| 1595 } | 1598 } |
| 1596 | 1599 |
| 1597 return FALSE; // Continue to propagate the event. | 1600 return FALSE; // Continue to propagate the event. |
| 1598 } | 1601 } |
| 1599 | 1602 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1770 // are taken from the WMs' source code. | 1773 // are taken from the WMs' source code. |
| 1771 return (wm_name == "Blackbox" || | 1774 return (wm_name == "Blackbox" || |
| 1772 wm_name == "compiz" || | 1775 wm_name == "compiz" || |
| 1773 wm_name == "e16" || // Enlightenment DR16 | 1776 wm_name == "e16" || // Enlightenment DR16 |
| 1774 wm_name == "Fluxbox" || | 1777 wm_name == "Fluxbox" || |
| 1775 wm_name == "KWin" || | 1778 wm_name == "KWin" || |
| 1776 wm_name == "Metacity" || | 1779 wm_name == "Metacity" || |
| 1777 wm_name == "Openbox" || | 1780 wm_name == "Openbox" || |
| 1778 wm_name == "Xfwm4"); | 1781 wm_name == "Xfwm4"); |
| 1779 } | 1782 } |
| OLD | NEW |