Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleCore.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 51 | { | |||
---|---|---|---|---|---|
61 | 61 | | |||
62 | // We might be using the XCB platform (with Xwayland) in a wayland session, | 62 | // We might be using the XCB platform (with Xwayland) in a wayland session, | ||
63 | // but the X11 grabber won't work in that case. So force the Wayland grabber | 63 | // but the X11 grabber won't work in that case. So force the Wayland grabber | ||
64 | // in Wayland sessions. | 64 | // in Wayland sessions. | ||
65 | if (KWindowSystem::isPlatformWayland() || qstrcmp(qgetenv("XDG_SESSION_TYPE"), "wayland") == 0) { | 65 | if (KWindowSystem::isPlatformWayland() || qstrcmp(qgetenv("XDG_SESSION_TYPE"), "wayland") == 0) { | ||
66 | mImageGrabber = new KWinWaylandImageGrabber; | 66 | mImageGrabber = new KWinWaylandImageGrabber; | ||
67 | } | 67 | } | ||
68 | #ifdef XCB_FOUND | 68 | #ifdef XCB_FOUND | ||
69 | else if (KWindowSystem::isPlatformX11()) { | 69 | if (!mImageGrabber && KWindowSystem::isPlatformX11()) { | ||
70 | mImageGrabber = new X11ImageGrabber; | 70 | mImageGrabber = new X11ImageGrabber; | ||
71 | } | 71 | } | ||
72 | #endif | 72 | #endif | ||
73 | 73 | | |||
74 | else { | 74 | if (!mImageGrabber) { | ||
75 | mImageGrabber = new DummyImageGrabber; | 75 | mImageGrabber = new DummyImageGrabber; | ||
76 | } | 76 | } | ||
77 | 77 | | |||
78 | setGrabMode(grabMode); | 78 | setGrabMode(grabMode); | ||
79 | mImageGrabber->setCapturePointer(guiConfig.readEntry("includePointer", true)); | 79 | mImageGrabber->setCapturePointer(guiConfig.readEntry("includePointer", true)); | ||
80 | mImageGrabber->setCaptureDecorations(guiConfig.readEntry("includeDecorations", true)); | 80 | mImageGrabber->setCaptureDecorations(guiConfig.readEntry("includeDecorations", true)); | ||
81 | 81 | | |||
82 | if ((!(mImageGrabber->onClickGrabSupported())) && (delayMsec < 0)) { | 82 | if ((!(mImageGrabber->onClickGrabSupported())) && (delayMsec < 0)) { | ||
Show All 22 Lines | |||||
105 | } | 105 | } | ||
106 | } | 106 | } | ||
107 | 107 | | |||
108 | SpectacleCore::~SpectacleCore() | 108 | SpectacleCore::~SpectacleCore() | ||
109 | { | 109 | { | ||
110 | if (mMainWindow) { | 110 | if (mMainWindow) { | ||
111 | delete mMainWindow; | 111 | delete mMainWindow; | ||
112 | } | 112 | } | ||
113 | delete mImageGrabber; | | |||
114 | } | 113 | } | ||
115 | 114 | | |||
116 | // Q_PROPERTY stuff | 115 | // Q_PROPERTY stuff | ||
117 | 116 | | |||
118 | QString SpectacleCore::filename() const | 117 | QString SpectacleCore::filename() const | ||
119 | { | 118 | { | ||
120 | return mFileNameString; | 119 | return mFileNameString; | ||
121 | } | 120 | } | ||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |