Changeset View
Changeset View
Standalone View
Standalone View
netinfo.cpp
Show All 27 Lines | |||||
28 | #include "workspace.h" | 28 | #include "workspace.h" | ||
29 | // Qt | 29 | // Qt | ||
30 | #include <QDebug> | 30 | #include <QDebug> | ||
31 | 31 | | |||
32 | namespace KWin | 32 | namespace KWin | ||
33 | { | 33 | { | ||
34 | extern int screen_number; | 34 | extern int screen_number; | ||
35 | 35 | | |||
36 | RootInfo *RootInfo::s_self = NULL; | 36 | RootInfo *RootInfo::s_self = nullptr; | ||
37 | 37 | | |||
38 | RootInfo *RootInfo::create() | 38 | RootInfo *RootInfo::create() | ||
39 | { | 39 | { | ||
40 | Q_ASSERT(!s_self); | 40 | Q_ASSERT(!s_self); | ||
41 | xcb_window_t supportWindow = xcb_generate_id(connection()); | 41 | xcb_window_t supportWindow = xcb_generate_id(connection()); | ||
42 | const uint32_t values[] = {true}; | 42 | const uint32_t values[] = {true}; | ||
43 | xcb_create_window(connection(), XCB_COPY_FROM_PARENT, supportWindow, KWin::rootWindow(), | 43 | xcb_create_window(connection(), XCB_COPY_FROM_PARENT, supportWindow, KWin::rootWindow(), | ||
44 | 0, 0, 1, 1, 0, XCB_COPY_FROM_PARENT, | 44 | 0, 0, 1, 1, 0, XCB_COPY_FROM_PARENT, | ||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | |||||
131 | 131 | | |||
132 | void RootInfo::destroy() | 132 | void RootInfo::destroy() | ||
133 | { | 133 | { | ||
134 | if (!s_self) { | 134 | if (!s_self) { | ||
135 | return; | 135 | return; | ||
136 | } | 136 | } | ||
137 | xcb_window_t supportWindow = s_self->supportWindow(); | 137 | xcb_window_t supportWindow = s_self->supportWindow(); | ||
138 | delete s_self; | 138 | delete s_self; | ||
139 | s_self = NULL; | 139 | s_self = nullptr; | ||
140 | xcb_destroy_window(connection(), supportWindow); | 140 | xcb_destroy_window(connection(), supportWindow); | ||
141 | } | 141 | } | ||
142 | 142 | | |||
143 | RootInfo::RootInfo(xcb_window_t w, const char *name, NET::Properties properties, NET::WindowTypes types, | 143 | RootInfo::RootInfo(xcb_window_t w, const char *name, NET::Properties properties, NET::WindowTypes types, | ||
144 | NET::States states, NET::Properties2 properties2, NET::Actions actions, int scr) | 144 | NET::States states, NET::Properties2 properties2, NET::Actions actions, int scr) | ||
145 | : NETRootInfo(connection(), w, name, properties, types, states, properties2, actions, scr) | 145 | : NETRootInfo(connection(), w, name, properties, types, states, properties2, actions, scr) | ||
146 | , m_activeWindow(activeWindow()) | 146 | , m_activeWindow(activeWindow()) | ||
147 | , m_eventFilter(std::make_unique<RootInfoFilter>(this)) | 147 | , m_eventFilter(std::make_unique<RootInfoFilter>(this)) | ||
Show All 23 Lines | 164 | if (Client* c = workspace->findClient(Predicate::WindowMatch, w)) { | |||
171 | else if (c == workspace->mostRecentlyActivatedClient()) { | 171 | else if (c == workspace->mostRecentlyActivatedClient()) { | ||
172 | return; // WORKAROUND? With > 1 plasma activities, we cause this ourselves. bug #240673 | 172 | return; // WORKAROUND? With > 1 plasma activities, we cause this ourselves. bug #240673 | ||
173 | } else { // NET::FromApplication | 173 | } else { // NET::FromApplication | ||
174 | Client* c2; | 174 | Client* c2; | ||
175 | if (workspace->allowClientActivation(c, timestamp, false, true)) | 175 | if (workspace->allowClientActivation(c, timestamp, false, true)) | ||
176 | workspace->activateClient(c); | 176 | workspace->activateClient(c); | ||
177 | // if activation of the requestor's window would be allowed, allow activation too | 177 | // if activation of the requestor's window would be allowed, allow activation too | ||
178 | else if (active_window != XCB_WINDOW_NONE | 178 | else if (active_window != XCB_WINDOW_NONE | ||
179 | && (c2 = workspace->findClient(Predicate::WindowMatch, active_window)) != NULL | 179 | && (c2 = workspace->findClient(Predicate::WindowMatch, active_window)) != nullptr | ||
180 | && workspace->allowClientActivation(c2, | 180 | && workspace->allowClientActivation(c2, | ||
181 | timestampCompare(timestamp, c2->userTime() > 0 ? timestamp : c2->userTime()), false, true)) { | 181 | timestampCompare(timestamp, c2->userTime() > 0 ? timestamp : c2->userTime()), false, true)) { | ||
182 | workspace->activateClient(c); | 182 | workspace->activateClient(c); | ||
183 | } else | 183 | } else | ||
184 | c->demandAttention(); | 184 | c->demandAttention(); | ||
185 | } | 185 | } | ||
186 | } | 186 | } | ||
187 | } | 187 | } | ||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 293 | if (mask & NET::Modal) | |||
294 | m_client->setModal((state & NET::Modal) != 0); | 294 | m_client->setModal((state & NET::Modal) != 0); | ||
295 | // unsetting fullscreen first, setting it last (because e.g. maximize works only for !isFullScreen() ) | 295 | // unsetting fullscreen first, setting it last (because e.g. maximize works only for !isFullScreen() ) | ||
296 | if ((mask & NET::FullScreen) != 0 && (state & NET::FullScreen) != 0) | 296 | if ((mask & NET::FullScreen) != 0 && (state & NET::FullScreen) != 0) | ||
297 | m_client->setFullScreen(true, false); | 297 | m_client->setFullScreen(true, false); | ||
298 | } | 298 | } | ||
299 | 299 | | |||
300 | void WinInfo::disable() | 300 | void WinInfo::disable() | ||
301 | { | 301 | { | ||
302 | m_client = NULL; // only used when the object is passed to Deleted | 302 | m_client = nullptr; // only used when the object is passed to Deleted | ||
303 | } | 303 | } | ||
304 | 304 | | |||
305 | } // namespace | 305 | } // namespace |