| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
| 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
| 7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
| 8 | 8 |
| 9 #include "app/x11_util.h" | 9 #include "app/x11_util.h" |
| 10 | 10 |
| 11 #include <gdk/gdk.h> | 11 #include <gdk/gdk.h> |
| 12 #include <gdk/gdkx.h> | 12 #include <gdk/gdkx.h> |
| 13 #include <gtk/gtk.h> | 13 #include <gtk/gtk.h> |
| 14 | 14 |
| 15 #include <sys/ipc.h> | 15 #include <sys/ipc.h> |
| 16 #include <sys/shm.h> | 16 #include <sys/shm.h> |
| 17 | 17 |
| 18 #include <list> | 18 #include <list> |
| 19 #include <set> | 19 #include <set> |
| 20 | 20 |
| 21 #include "base/command_line.h" | 21 #include "base/command_line.h" |
| 22 #include "base/logging.h" | 22 #include "base/logging.h" |
| 23 #include "base/thread.h" | 23 #include "base/thread.h" |
| 24 #include "app/x11_util_internal.h" | 24 #include "app/x11_util_internal.h" |
| 25 #include "gfx/rect.h" |
| 25 #include "gfx/size.h" | 26 #include "gfx/size.h" |
| 26 | 27 |
| 27 namespace x11_util { | 28 namespace x11_util { |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 // Used to cache the XRenderPictFormat for a visual/display pair. | 32 // Used to cache the XRenderPictFormat for a visual/display pair. |
| 32 struct CachedPictFormat { | 33 struct CachedPictFormat { |
| 33 bool equals(Display* display, Visual* visual) const { | 34 bool equals(Display* display, Visual* visual) const { |
| 34 return display == this->display && visual == this->visual; | 35 return display == this->display && visual == this->visual; |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 event.xclient.format = 32; | 820 event.xclient.format = 32; |
| 820 event.xclient.data.l[0] = desktop; | 821 event.xclient.data.l[0] = desktop; |
| 821 event.xclient.data.l[1] = 1; // source indication | 822 event.xclient.data.l[1] = 1; // source indication |
| 822 | 823 |
| 823 int result = XSendEvent(GetXDisplay(), GetX11RootWindow(), False, | 824 int result = XSendEvent(GetXDisplay(), GetX11RootWindow(), False, |
| 824 SubstructureNotifyMask, &event); | 825 SubstructureNotifyMask, &event); |
| 825 return result == Success; | 826 return result == Success; |
| 826 } | 827 } |
| 827 | 828 |
| 828 } // namespace x11_util | 829 } // namespace x11_util |
| OLD | NEW |