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

Unified Diff: ui/views/widget/desktop_aura/x11_window_event_filter.cc

Issue 78393003: linux_aura: Double clicking the titlebar should toggle maximized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for sadrul Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/x11_window_event_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/x11_window_event_filter.cc
diff --git a/ui/views/widget/desktop_aura/x11_window_event_filter.cc b/ui/views/widget/desktop_aura/x11_window_event_filter.cc
index 21835458d386cf30d93a133fa5c6c84dd44aa24f..3f415f0050d5170c34dae2f401851625b29531e3 100644
--- a/ui/views/widget/desktop_aura/x11_window_event_filter.cc
+++ b/ui/views/widget/desktop_aura/x11_window_event_filter.cc
@@ -16,6 +16,7 @@
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/gfx/x/x11_types.h"
+#include "ui/views/widget/desktop_aura/desktop_root_window_host.h"
#include "ui/views/widget/native_widget_aura.h"
namespace {
@@ -59,11 +60,13 @@ const char* kAtomsToCache[] = {
namespace views {
X11WindowEventFilter::X11WindowEventFilter(
- aura::RootWindow* root_window)
+ aura::RootWindow* root_window,
+ DesktopRootWindowHost* root_window_host)
: xdisplay_(gfx::GetXDisplay()),
xwindow_(root_window->host()->GetAcceleratedWidget()),
x_root_window_(DefaultRootWindow(xdisplay_)),
atom_cache_(xdisplay_, kAtomsToCache),
+ root_window_host_(root_window_host),
is_active_(false) {
}
@@ -100,6 +103,18 @@ void X11WindowEventFilter::OnMouseEvent(ui::MouseEvent* event) {
if (component == HTCLIENT)
return;
+ if (event->flags() & ui::EF_IS_DOUBLE_CLICK && component == HTCAPTION) {
+ // Our event is a double click in the caption area. We are responsible for
+ // dispatching this as a minimize/maximize on X11 (Windows converts this to
+ // min/max events for us).
+ if (root_window_host_->IsMaximized())
+ root_window_host_->Restore();
+ else
+ root_window_host_->Maximize();
+ event->SetHandled();
+ return;
+ }
+
// Get the |x_root_window_| location out of the native event.
if (event->native_event()) {
const gfx::Point x_root_location =
« no previous file with comments | « ui/views/widget/desktop_aura/x11_window_event_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698