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

Side by Side Diff: ui/gl/gl_surface_glx.cc

Issue 223483002: base: Do not allow MessagePumpObservers to consume events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r262009 Created 6 years, 8 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
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 extern "C" { 5 extern "C" {
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 } 7 }
8 8
9 #include "ui/gl/gl_surface_glx.h" 9 #include "ui/gl/gl_surface_glx.h"
10 10
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 gfx::AcceleratedWidget child_window) { 325 gfx::AcceleratedWidget child_window) {
326 DCHECK(child_to_parent_map_.find(child_window) != 326 DCHECK(child_to_parent_map_.find(child_window) !=
327 child_to_parent_map_.end()); 327 child_to_parent_map_.end());
328 child_to_parent_map_.erase(child_window); 328 child_to_parent_map_.erase(child_window);
329 329
330 if (child_to_parent_map_.empty()) 330 if (child_to_parent_map_.empty())
331 base::MessagePumpX11::Current()->RemoveObserver(this); 331 base::MessagePumpX11::Current()->RemoveObserver(this);
332 } 332 }
333 333
334 private: 334 private:
335 virtual base::EventStatus WillProcessEvent ( 335 virtual void WillProcessEvent(const base::NativeEvent& xevent) OVERRIDE {
336 const base::NativeEvent& xevent) OVERRIDE {
337 if (xevent->type != Expose) 336 if (xevent->type != Expose)
338 return base::EVENT_CONTINUE; 337 return;
339 338
340 WindowMap::const_iterator found = child_to_parent_map_.find( 339 WindowMap::const_iterator found = child_to_parent_map_.find(
341 xevent->xexpose.window); 340 xevent->xexpose.window);
342 if (found == child_to_parent_map_.end()) 341 if (found == child_to_parent_map_.end())
343 return base::EVENT_CONTINUE; 342 return;
344 343
345 gfx::AcceleratedWidget target_window = found->second; 344 gfx::AcceleratedWidget target_window = found->second;
346 XEvent forwarded_event = *xevent; 345 XEvent forwarded_event = *xevent;
347 forwarded_event.xexpose.window = target_window; 346 forwarded_event.xexpose.window = target_window;
348 XSendEvent(g_display, target_window, False, ExposureMask, 347 XSendEvent(g_display, target_window, False, ExposureMask,
349 &forwarded_event); 348 &forwarded_event);
350 return base::EVENT_CONTINUE;
351 } 349 }
352 virtual void DidProcessEvent(const base::NativeEvent& xevent) OVERRIDE { 350 virtual void DidProcessEvent(const base::NativeEvent& xevent) OVERRIDE {
353 } 351 }
354 352
355 typedef std::map<gfx::AcceleratedWidget, gfx::AcceleratedWidget> WindowMap; 353 typedef std::map<gfx::AcceleratedWidget, gfx::AcceleratedWidget> WindowMap;
356 WindowMap child_to_parent_map_; 354 WindowMap child_to_parent_map_;
357 355
358 DISALLOW_COPY_AND_ASSIGN(XExposeEventForwarder); 356 DISALLOW_COPY_AND_ASSIGN(XExposeEventForwarder);
359 }; 357 };
360 358
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 787
790 void* PbufferGLSurfaceGLX::GetConfig() { 788 void* PbufferGLSurfaceGLX::GetConfig() {
791 return config_; 789 return config_;
792 } 790 }
793 791
794 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { 792 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() {
795 Destroy(); 793 Destroy();
796 } 794 }
797 795
798 } // namespace gfx 796 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/events/platform/x11/x11_event_source.cc ('k') | ui/views/test/ui_controls_factory_desktop_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698