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

Side by Side Diff: ui/views/widget/desktop_aura/x11_window_event_filter.cc

Issue 23880006: gtk: Allow building both the X11 and Gtk message-pumps for gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/widget/desktop_aura/x11_window_event_filter.h" 5 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h"
6 6
7 #include <X11/extensions/XInput.h> 7 #include <X11/extensions/XInput.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
11 11
12 #include "base/message_loop/message_pump_aurax11.h" 12 #include "base/message_loop/message_pump_x11.h"
13 #include "ui/aura/root_window.h" 13 #include "ui/aura/root_window.h"
14 #include "ui/aura/window_delegate.h" 14 #include "ui/aura/window_delegate.h"
15 #include "ui/base/events/event.h" 15 #include "ui/base/events/event.h"
16 #include "ui/base/events/event_utils.h" 16 #include "ui/base/events/event_utils.h"
17 #include "ui/base/hit_test.h" 17 #include "ui/base/hit_test.h"
18 #include "ui/views/widget/native_widget_aura.h" 18 #include "ui/views/widget/native_widget_aura.h"
19 19
20 namespace { 20 namespace {
21 21
22 // These constants are defined in the Extended Window Manager Hints 22 // These constants are defined in the Extended Window Manager Hints
(...skipping 29 matching lines...) Expand all
52 "_NET_WM_MOVERESIZE", 52 "_NET_WM_MOVERESIZE",
53 NULL 53 NULL
54 }; 54 };
55 55
56 } // namespace 56 } // namespace
57 57
58 namespace views { 58 namespace views {
59 59
60 X11WindowEventFilter::X11WindowEventFilter( 60 X11WindowEventFilter::X11WindowEventFilter(
61 aura::RootWindow* root_window) 61 aura::RootWindow* root_window)
62 : xdisplay_(base::MessagePumpAuraX11::GetDefaultXDisplay()), 62 : xdisplay_(base::MessagePumpX11::GetDefaultXDisplay()),
63 xwindow_(root_window->GetAcceleratedWidget()), 63 xwindow_(root_window->GetAcceleratedWidget()),
64 x_root_window_(DefaultRootWindow(xdisplay_)), 64 x_root_window_(DefaultRootWindow(xdisplay_)),
65 atom_cache_(xdisplay_, kAtomsToCache), 65 atom_cache_(xdisplay_, kAtomsToCache),
66 is_active_(false) { 66 is_active_(false) {
67 } 67 }
68 68
69 X11WindowEventFilter::~X11WindowEventFilter() { 69 X11WindowEventFilter::~X11WindowEventFilter() {
70 } 70 }
71 71
72 void X11WindowEventFilter::SetUseHostWindowBorders(bool use_os_border) { 72 void X11WindowEventFilter::SetUseHostWindowBorders(bool use_os_border) {
73 MotifWmHints motif_hints; 73 MotifWmHints motif_hints;
74 memset(&motif_hints, 0, sizeof(motif_hints)); 74 memset(&motif_hints, 0, sizeof(motif_hints));
75 motif_hints.flags = kHintsDecorations; 75 motif_hints.flags = kHintsDecorations;
76 motif_hints.decorations = use_os_border ? 1 : 0; 76 motif_hints.decorations = use_os_border ? 1 : 0;
77 77
78 ::Atom hint_atom = atom_cache_.GetAtom("_MOTIF_WM_HINTS"); 78 ::Atom hint_atom = atom_cache_.GetAtom("_MOTIF_WM_HINTS");
79 XChangeProperty(base::MessagePumpAuraX11::GetDefaultXDisplay(), 79 XChangeProperty(base::MessagePumpX11::GetDefaultXDisplay(),
80 xwindow_, 80 xwindow_,
81 hint_atom, 81 hint_atom,
82 hint_atom, 82 hint_atom,
83 32, 83 32,
84 PropModeReplace, 84 PropModeReplace,
85 reinterpret_cast<unsigned char*>(&motif_hints), 85 reinterpret_cast<unsigned char*>(&motif_hints),
86 sizeof(MotifWmHints)/sizeof(long)); 86 sizeof(MotifWmHints)/sizeof(long));
87 } 87 }
88 88
89 void X11WindowEventFilter::OnMouseEvent(ui::MouseEvent* event) { 89 void X11WindowEventFilter::OnMouseEvent(ui::MouseEvent* event) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 event.xclient.data.l[4] = 0; 164 event.xclient.data.l[4] = 0;
165 165
166 XSendEvent(xdisplay_, x_root_window_, False, 166 XSendEvent(xdisplay_, x_root_window_, False,
167 SubstructureRedirectMask | SubstructureNotifyMask, 167 SubstructureRedirectMask | SubstructureNotifyMask,
168 &event); 168 &event);
169 169
170 return true; 170 return true;
171 } 171 }
172 172
173 } // namespace views 173 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698