MCPcopy Create free account
hub / github.com/KDE/kwin / addWaylandWindow

Method addWaylandWindow

src/workspace.cpp:910–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908}
909
910void 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
956void Workspace::removeWaylandWindow(Window *window)
957{

Callers

nothing calls this directly

Calls 13

updateLayerMethod · 0.80
isPlacedMethod · 0.80
appendMethod · 0.80
activationTokenMethod · 0.80
isDesktopMethod · 0.80
demandAttentionMethod · 0.80
isPlaceableMethod · 0.45
placeMethod · 0.45
containsMethod · 0.45
wantsInputMethod · 0.45
isPopupWindowMethod · 0.45
hasStrutMethod · 0.45

Tested by

no test coverage detected