When the current window has multiple panes, remove the pane from this
        window and put it in a new window.

        :param set_active: When True, focus the new window.
979649
def break_pane(self, set_active=True):
        
        w = self.get_active_window()

        if len(w.panes) > 1:
            pane = w.active_pane
            self.get_active_window().remove_pane(pane)
            self.create_window(pane, set_active=set_active)
299721
def _close_window(self, window):
        
        if window == self.active_window:
            self.close_active_window()
        else:
            original_active_window = self.active_window
            self.close_active_window()
            self.active_window = original_active_window
260698
function(e) {
			var self = this;
	
			if (self.isLocked) return;
			if (self.settings.mode === 'multi') {
				e.preventDefault();
				self.setActiveItem(e.currentTarget, e);
			}
		}
510519
function() {

        var activeElement = this.__activeElement;
        var now = getActiveElement();
        var isBlur = arguments[0];
        var node = this.node;

        if (isBlur !== false && node.contains(now)) {
            this.__focus(activeElement);
        }

        this.__autofocus = false;
        removeClass(node, this.__name('focus'));

        return this;
    }
1173703
def attached_window(self):
        
        active_windows = []
        for window in self._windows:
            if 'window_active' in window:
                # for now window_active is a unicode
                if window.get('window_active') == '1':
                    active_windows.append(Window(session=self, **window))
                else:
                    continue

        if len(active_windows) == int(1):
            return active_windows[0]
        else:
            raise exc.LibTmuxException(
                'multiple active windows found. %s' % active_windows
            )

        if len(self._windows) == int(0):
            raise exc.LibTmuxException('No Windows')
1130079
def reparent_window(self, window_source, window_target):
        
        _libxdo.xdo_reparent_window(self._xdo, window_source, window_target)
1275896
def write_selection(pane, active_cell, sqref) #:nodoc:
      attributes  = []
      attributes << ['pane', pane]              if pane
      attributes << ['activeCell', active_cell] if active_cell
      attributes << ['sqref', sqref]            if sqref

      @writer.empty_tag('selection', attributes)
    end
144096
def change_size_for_active_pane(self, up=0, right=0, down=0, left=0):
        
        child = self.active_pane
        self.change_size_for_pane(child, up=up, right=right, down=down, left=left)
959017
def _move_focus(pymux, get_x, get_y):
    "  "
    window = pymux.arrangement.get_active_window()

    try:
        write_pos = pymux.get_client_state().layout_manager.pane_write_positions[window.active_pane]
    except KeyError:
        pass
    else:
        x = get_x(write_pos)
        y = get_y(write_pos)

        # Look for the pane at this position.
        for pane, wp in pymux.get_client_state().layout_manager.pane_write_positions.items():
            if (wp.xpos <= x < wp.xpos + wp.width and
                    wp.ypos <= y < wp.ypos + wp.height):
                window.active_pane = pane
                return
149564
def close_active_window(self):
        
        active_split = self._get_active_split()

        # First remove the active window from its split.
        index = active_split.index(self.active_window)
        del active_split[index]

        # Move focus.
        if len(active_split):
            new_active_window = active_split[max(0, index - 1)]
            while isinstance(new_active_window, (HSplit, VSplit)):
                new_active_window = new_active_window[0]
            self.active_window = new_active_window
        else:
            self.active_window = None  # No windows left.

        # When there is exactly on item left, move this back into the parent
        # split. (We don't want to keep a split with one item around -- exept
        # for the root.)
        if len(active_split) == 1 and active_split != self.root:
            parent = self._get_split_parent(active_split)
            index = parent.index(active_split)
            parent[index] = active_split[0]
283792
public void setActive(final boolean SELECTED) {
        if (null == active) {
            _active = SELECTED;
            fireTileEvent(REDRAW_EVENT);
        } else {
            active.set(SELECTED);
        }
    }
278281
def get_active_window(self):
        
        app = get_app()

        try:
            return self._active_window_for_cli[app]
        except KeyError:
            self._active_window_for_cli[app] = self._last_active_window or self.windows[0]
            return self.windows[0]
188053
@Override
    public boolean setActive() {
        WebLocator inactiveTab = getTitleInactiveEl().setExcludeClasses("x-tab-active");
        boolean activated = isActive() || inactiveTab.click();
        if (activated) {
            log.info("setActive : " + toString());
        }
        return activated;
    }
6347
def remove_active_label(self, active_label):
        

        if not active_label in self.__active_labels:
            raise foundations.exceptions.ProgrammingError("{0} | '{1}' is not in the collection!".format(
                self.__class__.__name__, active_label))

        self.__active_labels.remove(active_label)
        return True
1031136
def _split(self, split_cls, editor_buffer=None):
        
        if editor_buffer is None:
            editor_buffer = self.active_window.editor_buffer

        active_split = self._get_active_split()
        index = active_split.index(self.active_window)
        new_window = Window(editor_buffer)

        if isinstance(active_split, split_cls):
            # Add new window to active split.
            active_split.insert(index, new_window)
        else:
            # Split in the other direction.
            active_split[index] = split_cls([active_split[index], new_window])

        # Focus new window.
        self.active_window = new_window
1176604
def qteFocusChanged(self, old, new):
        
        # Do nothing if new is old.
        if old is new:
            return

        # If neither is None but both have the same top level
        # window then do nothing.
        if (old is not None) and (new is not None):
            if old.isActiveWindow() is new.isActiveWindow():
                return
51307
public void setActivePage(DialogPage activePage) {
		DialogPage oldPage = this.activePage;

		Assert.isTrue(activePage == null || pages.contains(activePage));
		if (oldPage == activePage) {
			return;
		}
		this.activePage = activePage;

		updateMessage();
		if (oldPage != null) {
			updatePageLabels(oldPage);
		}
		if (activePage != null) {
			updatePageLabels(activePage);
		}
	}