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

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

Issue 1034173004: x11: Reset the window handle after destroying it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | 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 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 return true; 459 return true;
460 } 460 }
461 461
462 void NativeViewGLSurfaceGLX::Destroy() { 462 void NativeViewGLSurfaceGLX::Destroy() {
463 if (window_) { 463 if (window_) {
464 ui::PlatformEventSource* event_source = 464 ui::PlatformEventSource* event_source =
465 ui::PlatformEventSource::GetInstance(); 465 ui::PlatformEventSource::GetInstance();
466 if (event_source) 466 if (event_source)
467 event_source->RemovePlatformEventDispatcher(this); 467 event_source->RemovePlatformEventDispatcher(this);
468 XDestroyWindow(g_display, window_); 468 XDestroyWindow(g_display, window_);
469 window_ = 0;
469 XFlush(g_display); 470 XFlush(g_display);
470 } 471 }
471 } 472 }
472 473
473 bool NativeViewGLSurfaceGLX::CanDispatchEvent(const ui::PlatformEvent& event) { 474 bool NativeViewGLSurfaceGLX::CanDispatchEvent(const ui::PlatformEvent& event) {
474 return event->type == Expose && event->xexpose.window == window_; 475 return event->type == Expose && event->xexpose.window == window_;
475 } 476 }
476 477
477 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) { 478 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) {
478 XEvent forwarded_event = *event; 479 XEvent forwarded_event = *event;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 675
675 void* PbufferGLSurfaceGLX::GetConfig() { 676 void* PbufferGLSurfaceGLX::GetConfig() {
676 return config_; 677 return config_;
677 } 678 }
678 679
679 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { 680 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() {
680 Destroy(); 681 Destroy();
681 } 682 }
682 683
683 } // namespace gfx 684 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698