MCPcopy
hub / github.com/paperwm/PaperWM / updateSelection

Function updateSelection

tiling.js:4406–4434  ·  view source on GitHub ↗
(space, metaWindow)

Source from the content-addressed store, hash-verified

4404}
4405
4406export function updateSelection(space, metaWindow) {
4407 if (!metaWindow) {
4408 return;
4409 }
4410 let clone = metaWindow.clone;
4411 let cloneActor = clone.cloneActor;
4412
4413 // first set all selections inactive
4414 // this means not active workspaces are shown as inactive
4415 setAllWorkspacesInactive();
4416
4417 // if metawindow has transient window(s) and it's NOT focused,
4418 // don't update visual selection (since transient is actually focused)
4419 if (hasTransient(metaWindow) && metaWindow !== display.focus_window) {
4420 space.setSelectionInactive();
4421 }
4422 else {
4423 // then set the new selection active
4424 space.setSelectionActive();
4425 }
4426
4427 space.updateWindowPositionBar();
4428
4429 if (space.selection.get_parent() === clone)
4430 return;
4431 Utils.actor_reparent(space.selection, clone);
4432 clone.set_child_below_sibling(space.selection, cloneActor);
4433 allocateClone(metaWindow);
4434}
4435
4436/**
4437 * Move the column containing @meta_window to x, y and propagate the change

Callers 1

ensureViewportFunction · 0.85

Calls 6

setAllWorkspacesInactiveFunction · 0.85
hasTransientFunction · 0.85
allocateCloneFunction · 0.85
setSelectionInactiveMethod · 0.80
setSelectionActiveMethod · 0.80

Tested by

no test coverage detected