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

Side by Side Diff: ui/base/clipboard/clipboard_gtk.cc

Issue 23460052: Move XID, XDisplay, GetXDisplay and a few other types to ui/gfx/x/x11_types.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sdf 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
« no previous file with comments | « ui/base/clipboard/clipboard_aurax11.cc ('k') | ui/base/cursor/cursor_loader_x11.cc » ('j') | 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/base/clipboard/clipboard.h" 5 #include "ui/base/clipboard/clipboard.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <X11/extensions/Xfixes.h> 8 #include <X11/extensions/Xfixes.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <map> 10 #include <map>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 DISALLOW_COPY_AND_ASSIGN(SelectionChangeObserver); 56 DISALLOW_COPY_AND_ASSIGN(SelectionChangeObserver);
57 }; 57 };
58 58
59 SelectionChangeObserver::SelectionChangeObserver() 59 SelectionChangeObserver::SelectionChangeObserver()
60 : event_base_(-1), 60 : event_base_(-1),
61 clipboard_atom_(None), 61 clipboard_atom_(None),
62 clipboard_sequence_number_(0), 62 clipboard_sequence_number_(0),
63 primary_sequence_number_(0) { 63 primary_sequence_number_(0) {
64 int ignored; 64 int ignored;
65 if (XFixesQueryExtension(GetXDisplay(), &event_base_, &ignored)) { 65 if (XFixesQueryExtension(gfx::GetXDisplay(), &event_base_, &ignored)) {
66 clipboard_atom_ = XInternAtom(GetXDisplay(), "CLIPBOARD", false); 66 clipboard_atom_ = XInternAtom(gfx::GetXDisplay(), "CLIPBOARD", false);
67 XFixesSelectSelectionInput(GetXDisplay(), GetX11RootWindow(), 67 XFixesSelectSelectionInput(gfx::GetXDisplay(), GetX11RootWindow(),
68 clipboard_atom_, 68 clipboard_atom_,
69 XFixesSetSelectionOwnerNotifyMask | 69 XFixesSetSelectionOwnerNotifyMask |
70 XFixesSelectionWindowDestroyNotifyMask | 70 XFixesSelectionWindowDestroyNotifyMask |
71 XFixesSelectionClientCloseNotifyMask); 71 XFixesSelectionClientCloseNotifyMask);
72 // This seems to be semi-optional. For some reason, registering for any 72 // This seems to be semi-optional. For some reason, registering for any
73 // selection notify events seems to subscribe us to events for both the 73 // selection notify events seems to subscribe us to events for both the
74 // primary and the clipboard buffers. Register anyway just to be safe. 74 // primary and the clipboard buffers. Register anyway just to be safe.
75 XFixesSelectSelectionInput(GetXDisplay(), GetX11RootWindow(), 75 XFixesSelectSelectionInput(gfx::GetXDisplay(), GetX11RootWindow(),
76 XA_PRIMARY, 76 XA_PRIMARY,
77 XFixesSetSelectionOwnerNotifyMask | 77 XFixesSetSelectionOwnerNotifyMask |
78 XFixesSelectionWindowDestroyNotifyMask | 78 XFixesSelectionWindowDestroyNotifyMask |
79 XFixesSelectionClientCloseNotifyMask); 79 XFixesSelectionClientCloseNotifyMask);
80 gdk_window_add_filter(NULL, &SelectionChangeObserver::OnXEventThunk, this); 80 gdk_window_add_filter(NULL, &SelectionChangeObserver::OnXEventThunk, this);
81 } 81 }
82 } 82 }
83 83
84 SelectionChangeObserver::~SelectionChangeObserver() { 84 SelectionChangeObserver::~SelectionChangeObserver() {
85 } 85 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 return clipboard_; 673 return clipboard_;
674 case BUFFER_SELECTION: 674 case BUFFER_SELECTION:
675 return primary_selection_; 675 return primary_selection_;
676 default: 676 default:
677 NOTREACHED(); 677 NOTREACHED();
678 return NULL; 678 return NULL;
679 } 679 }
680 } 680 }
681 681
682 } // namespace ui 682 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_aurax11.cc ('k') | ui/base/cursor/cursor_loader_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698