Changeset View
Changeset View
Standalone View
Standalone View
platform.cpp
Show All 14 Lines | |||||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "platform.h" | 20 | #include "platform.h" | ||
21 | 21 | | |||
22 | #include "abstract_output.h" | 22 | #include "abstract_output.h" | ||
23 | #include "atoms.h" | ||||
23 | #include <config-kwin.h> | 24 | #include <config-kwin.h> | ||
24 | #include "composite.h" | 25 | #include "composite.h" | ||
25 | #include "cursor.h" | 26 | #include "cursor.h" | ||
26 | #include "effects.h" | 27 | #include "effects.h" | ||
27 | #include <KCoreAddons> | 28 | #include <KCoreAddons> | ||
28 | #include "overlaywindow.h" | 29 | #include "overlaywindow.h" | ||
29 | #include "outline.h" | 30 | #include "outline.h" | ||
30 | #include "pointer_input.h" | 31 | #include "pointer_input.h" | ||
31 | #include "scene.h" | 32 | #include "scene.h" | ||
32 | #include "screens.h" | 33 | #include "screens.h" | ||
33 | #include "screenedge.h" | 34 | #include "screenedge.h" | ||
34 | #include "wayland_server.h" | 35 | #include "wayland_server.h" | ||
35 | #include "colorcorrection/manager.h" | 36 | #include "colorcorrection/manager.h" | ||
36 | 37 | | |||
38 | #include "xcb/xproto.h" | ||||
39 | | ||||
zzag: This include must come after `#include "abstract_output.h"` | |||||
37 | #include <KWayland/Server/outputconfiguration_interface.h> | 40 | #include <KWayland/Server/outputconfiguration_interface.h> | ||
38 | #include <KWayland/Server/outputchangeset.h> | 41 | #include <KWayland/Server/outputchangeset.h> | ||
39 | 42 | | |||
40 | namespace KWin | 43 | namespace KWin | ||
41 | { | 44 | { | ||
42 | 45 | | |||
43 | Platform::Platform(QObject *parent) | 46 | Platform::Platform(QObject *parent) | ||
44 | : QObject(parent) | 47 | : QObject(parent) | ||
45 | , m_eglDisplay(EGL_NO_DISPLAY) | 48 | , m_eglDisplay(EGL_NO_DISPLAY) | ||
46 | { | 49 | { | ||
47 | setSoftWareCursor(false); | 50 | setSoftWareCursor(false); | ||
48 | m_colorCorrect = new ColorCorrect::Manager(this); | 51 | m_colorCorrect = new ColorCorrect::Manager(this); | ||
49 | connect(Cursors::self(), &Cursors::currentCursorRendered, this, &Platform::cursorRendered); | 52 | connect(Cursors::self(), &Cursors::currentCursorRendered, this, &Platform::cursorRendered); | ||
50 | } | 53 | } | ||
51 | 54 | | |||
52 | Platform::~Platform() | 55 | Platform::~Platform() | ||
53 | { | 56 | { | ||
54 | if (m_eglDisplay != EGL_NO_DISPLAY) { | 57 | if (m_eglDisplay != EGL_NO_DISPLAY) { | ||
55 | eglTerminate(m_eglDisplay); | 58 | eglTerminate(m_eglDisplay); | ||
56 | } | 59 | } | ||
57 | } | 60 | } | ||
Move/resize operations is something that Workspace needs to be concerned about. Please create the filter in Workspace::initWithX11(). zzag: Move/resize operations is something that Workspace needs to be concerned about. Please create… | |||||
58 | 61 | | |||
59 | PlatformCursorImage Platform::cursorImage() const | 62 | PlatformCursorImage Platform::cursorImage() const | ||
60 | { | 63 | { | ||
61 | Cursor* cursor = Cursors::self()->currentCursor(); | 64 | Cursor* cursor = Cursors::self()->currentCursor(); | ||
62 | return PlatformCursorImage(cursor->image(), cursor->hotspot()); | 65 | return PlatformCursorImage(cursor->image(), cursor->hotspot()); | ||
63 | } | 66 | } | ||
64 | 67 | | |||
65 | void Platform::hideCursor() | 68 | void Platform::hideCursor() | ||
▲ Show 20 Lines • Show All 430 Lines • ▼ Show 20 Line(s) | 498 | { | |||
496 | Q_UNUSED(action) | 499 | Q_UNUSED(action) | ||
497 | } | 500 | } | ||
498 | 501 | | |||
499 | OverlayWindow *Platform::createOverlayWindow() | 502 | OverlayWindow *Platform::createOverlayWindow() | ||
500 | { | 503 | { | ||
501 | return nullptr; | 504 | return nullptr; | ||
502 | } | 505 | } | ||
503 | 506 | | |||
507 | | ||||
508 | /** | ||||
509 | * Updates xTime(). This used to simply fetch current timestamp from the server, | ||||
510 | * but that can cause xTime() to be newer than timestamp of events that are | ||||
511 | * still in our events queue, thus e.g. making XSetInputFocus() caused by such | ||||
512 | * event to be ignored. Therefore events queue is searched for first | ||||
513 | * event with timestamp, and extra PropertyNotify is generated in order to make | ||||
514 | * sure such event is found. | ||||
515 | */ | ||||
While you're on this, could you please re-format this comment? /** * Heart touching doxygen comment. */ void Platform::updateXTime() { } zzag: While you're on this, could you please re-format this comment?
```lang=cpp
/**
* Heart… | |||||
504 | void Platform::updateXTime() | 516 | void Platform::updateXTime() | ||
505 | { | 517 | { | ||
518 | // change a dummy property so that we get an event caught in Application::updateX11Time | ||||
519 | xcb_window_t window = rootWindow(); | ||||
520 | | ||||
521 | xcb_change_property(connection(), XCB_PROP_MODE_APPEND, window, atoms->clipboard, | ||||
522 | XCB_ATOM_INTEGER, 32, 0, nullptr); | ||||
523 | xcb_flush(connection()); | ||||
524 | | ||||
525 | // from xcb_aux_sync | ||||
526 | xcb_get_input_focus_cookie_t cookie = xcb_get_input_focus(connection()); | ||||
527 | free(xcb_get_input_focus_reply(connection(), cookie, 0)); | ||||
528 | | ||||
529 | // will update | ||||
530 | kwinApp()->setUpdatingXTimer(true); | ||||
506 | } | 531 | } | ||
507 | 532 | | |||
508 | OutlineVisual *Platform::createOutline(Outline *outline) | 533 | OutlineVisual *Platform::createOutline(Outline *outline) | ||
509 | { | 534 | { | ||
510 | if (Compositor::compositing()) { | 535 | if (Compositor::compositing()) { | ||
511 | return new CompositedOutlineVisual(outline); | 536 | return new CompositedOutlineVisual(outline); | ||
512 | } | 537 | } | ||
513 | return nullptr; | 538 | return nullptr; | ||
Show All 31 Lines |
This include must come after #include "abstract_output.h"