Changeset View
Changeset View
Standalone View
Standalone View
geometry.cpp
Show First 20 Lines • Show All 2448 Lines • ▼ Show 20 Line(s) | 2448 | { | |||
---|---|---|---|---|---|
2449 | if (!isFullScreenable()) { | 2449 | if (!isFullScreenable()) { | ||
2450 | return false; | 2450 | return false; | ||
2451 | } | 2451 | } | ||
2452 | return isNormalWindow() || isDialog(); | 2452 | return isNormalWindow() || isDialog(); | ||
2453 | } | 2453 | } | ||
2454 | 2454 | | |||
2455 | void Client::setFullScreen(bool set, bool user) | 2455 | void Client::setFullScreen(bool set, bool user) | ||
2456 | { | 2456 | { | ||
2457 | set = rules()->checkFullScreen(set); | ||||
2458 | | ||||
2457 | const bool wasFullscreen = isFullScreen(); | 2459 | const bool wasFullscreen = isFullScreen(); | ||
2458 | if (!wasFullscreen && !set) { | 2460 | if (wasFullscreen == set) { | ||
2459 | return; | 2461 | return; | ||
2460 | } | 2462 | } | ||
2461 | if (user && !userCanSetFullScreen()) { | 2463 | if (user && !userCanSetFullScreen()) { | ||
2462 | return; | 2464 | return; | ||
2463 | } | 2465 | } | ||
2464 | 2466 | | |||
2465 | set = rules()->checkFullScreen(set && !isSpecialWindow()); | | |||
2466 | setShade(ShadeNone); | 2467 | setShade(ShadeNone); | ||
2467 | 2468 | | |||
2468 | if (wasFullscreen) { | 2469 | if (wasFullscreen) { | ||
2469 | workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event | 2470 | workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event | ||
2470 | } else { | 2471 | } else { | ||
2471 | geom_fs_restore = geometry(); | 2472 | geom_fs_restore = geometry(); | ||
2472 | } | 2473 | } | ||
2473 | 2474 | | |||
2474 | m_fullscreenMode = set ? FullScreenNormal : FullScreenNone; | | |||
2475 | if (wasFullscreen == isFullScreen()) { | | |||
2476 | return; | | |||
2477 | } | | |||
2478 | if (set) { | 2475 | if (set) { | ||
2476 | m_fullscreenMode = FullScreenNormal; | ||||
2479 | untab(); | 2477 | untab(); | ||
2480 | workspace()->raiseClient(this); | 2478 | workspace()->raiseClient(this); | ||
2479 | } else { | ||||
2480 | m_fullscreenMode = FullScreenNone; | ||||
2481 | } | 2481 | } | ||
2482 | 2482 | | |||
2483 | StackingUpdatesBlocker blocker1(workspace()); | 2483 | StackingUpdatesBlocker blocker1(workspace()); | ||
2484 | GeometryUpdatesBlocker blocker2(this); | 2484 | GeometryUpdatesBlocker blocker2(this); | ||
2485 | workspace()->updateClientLayer(this); // active fullscreens get different layer | 2485 | | ||
2486 | // active fullscreens get different layer | ||||
2487 | workspace()->updateClientLayer(this); | ||||
2486 | 2488 | | |||
2487 | info->setState(isFullScreen() ? NET::FullScreen : NET::States(0), NET::FullScreen); | 2489 | info->setState(isFullScreen() ? NET::FullScreen : NET::States(0), NET::FullScreen); | ||
2488 | updateDecoration(false, false); | 2490 | updateDecoration(false, false); | ||
2489 | 2491 | | |||
2490 | if (isFullScreen()) { | 2492 | if (set) { | ||
2491 | if (info->fullscreenMonitors().isSet()) { | 2493 | if (info->fullscreenMonitors().isSet()) { | ||
2492 | setGeometry(fullscreenMonitorsArea(info->fullscreenMonitors())); | 2494 | setGeometry(fullscreenMonitorsArea(info->fullscreenMonitors())); | ||
2493 | } else { | 2495 | } else { | ||
2494 | setGeometry(workspace()->clientArea(FullScreenArea, this)); | 2496 | setGeometry(workspace()->clientArea(FullScreenArea, this)); | ||
2495 | } | 2497 | } | ||
2496 | } else { | 2498 | } else { | ||
2497 | if (!geom_fs_restore.isNull()) { | 2499 | Q_ASSERT(!geom_fs_restore.isNull()); | ||
2498 | const int currentScreen = screen(); | 2500 | const int currentScreen = screen(); | ||
2499 | setGeometry(QRect(geom_fs_restore.topLeft(), adjustedSize(geom_fs_restore.size()))); | 2501 | setGeometry(QRect(geom_fs_restore.topLeft(), adjustedSize(geom_fs_restore.size()))); | ||
2500 | if(currentScreen != screen()) { | 2502 | if(currentScreen != screen()) { | ||
zzag: shtoyle: https://techbase.kde.org/Policies/Frameworks_Coding_Style#Whitespace | |||||
2501 | workspace()->sendClientToScreen( this, currentScreen ); | 2503 | workspace()->sendClientToScreen(this, currentScreen); | ||
2502 | } | 2504 | } | ||
2503 | // TODO isShaded() ? | | |||
2504 | } else { | | |||
2505 | // does this ever happen? | | |||
zzag: Is it possible to have have a client initially in the fullscreen state? | |||||
Yes, but when it does this it goes through this part in the beginning. m_fullscreenMode is set to "no fullscreen" in the Client constructor and is only changed in this function here, where geom_fs_restore is set above in case it goes fullscreen. romangg: Yes, but when it does this it goes through this part in the beginning.
`m_fullscreenMode` is… | |||||
2506 | setGeometry(workspace()->clientArea(MaximizeArea, this)); | | |||
2507 | } | | |||
2508 | } | 2505 | } | ||
2509 | 2506 | | |||
2510 | updateWindowRules(Rules::Fullscreen | Rules::Position | Rules::Size); | 2507 | updateWindowRules(Rules::Fullscreen | Rules::Position | Rules::Size); | ||
2511 | | ||||
2512 | if (wasFullscreen != isFullScreen()) { | | |||
2513 | emit clientFullScreenSet(this, set, user); | 2508 | emit clientFullScreenSet(this, set, user); | ||
2514 | emit fullScreenChanged(); | 2509 | emit fullScreenChanged(); | ||
2515 | } | 2510 | } | ||
2516 | } | | |||
2517 | 2511 | | |||
2518 | 2512 | | |||
2519 | void Client::updateFullscreenMonitors(NETFullscreenMonitors topology) | 2513 | void Client::updateFullscreenMonitors(NETFullscreenMonitors topology) | ||
2520 | { | 2514 | { | ||
2521 | int nscreens = screens()->count(); | 2515 | int nscreens = screens()->count(); | ||
2522 | 2516 | | |||
2523 | // qDebug() << "incoming request with top: " << topology.top << " bottom: " << topology.bottom | 2517 | // qDebug() << "incoming request with top: " << topology.top << " bottom: " << topology.bottom | ||
2524 | // << " left: " << topology.left << " right: " << topology.right | 2518 | // << " left: " << topology.left << " right: " << topology.right | ||
▲ Show 20 Lines • Show All 924 Lines • Show Last 20 Lines |
shtoyle: https://techbase.kde.org/Policies/Frameworks_Coding_Style#Whitespace