| 908 | } |
| 909 | |
| 910 | void Workspace::addWaylandWindow(Window *window) |
| 911 | { |
| 912 | if (showingDesktop() && breaksShowingDesktop(window)) { |
| 913 | setShowingDesktop(false); |
| 914 | } |
| 915 | |
| 916 | setupWindowConnections(window); |
| 917 | window->updateLayer(); |
| 918 | |
| 919 | if (window->isPlaceable() && !window->isPlaced()) { |
| 920 | const RectF area = clientArea(PlacementArea, window, activeOutput()); |
| 921 | if (const auto placement = m_placement->place(window, area)) { |
| 922 | window->place(*placement); |
| 923 | } |
| 924 | } |
| 925 | Q_ASSERT(!m_windows.contains(window)); |
| 926 | m_windows.append(window); |
| 927 | addToStack(window); |
| 928 | |
| 929 | const bool shouldActivate = window->wantsInput() && !window->isPopupWindow() |
| 930 | && ((mayActivate(window, window->activationToken()) && !window->isDesktop()) |
| 931 | // focus stealing prevention "low" should always activate new windows |
| 932 | || (!window->isDesktop() && options->focusStealingPreventionLevel() <= FocusStealingPreventionLevel::Low) |
| 933 | // If there's no active window, make this desktop the active one. |
| 934 | || !activeWindow()); |
| 935 | if (!window->isMinimized() && !shouldActivate && !window->isPopupWindow()) { |
| 936 | // This window won't be activated, so move it out of the way |
| 937 | // of the active window |
| 938 | restackWindowUnderActive(window); |
| 939 | } |
| 940 | |
| 941 | updateStackingOrder(true); |
| 942 | if (window->hasStrut()) { |
| 943 | rearrange(); |
| 944 | } |
| 945 | if (!window->isMinimized()) { |
| 946 | if (shouldActivate) { |
| 947 | activateWindow(window); |
| 948 | } else if (!window->activationToken().isEmpty()) { |
| 949 | window->demandAttention(); |
| 950 | } |
| 951 | } |
| 952 | updateTabbox(); |
| 953 | Q_EMIT windowAdded(window); |
| 954 | } |
| 955 | |
| 956 | void Workspace::removeWaylandWindow(Window *window) |
| 957 | { |
nothing calls this directly
no test coverage detected