• 3H3x36tBElshOa@feddit.nlOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    13 days ago
    
    Action::SwapWindow => {
        let current_output = seat.active_output();
        let mut shell = self.common.shell.write().unwrap();
    
        let workspace = shell.active_space_mut(&current_output);
        if workspace.get_fullscreen().is_some() {
            return; // TODO, is this what we want? Maybe disengage fullscreen instead?
        }
    
        let keyboard_handle = seat.get_keyboard().unwrap();
        if let Some(focus) = keyboard_handle.current_focus() {
            if let Some(descriptor) = workspace.node_desc(focus) {
                let grab = SwapWindowGrab::new(seat.clone(), descriptor.clone());
                drop(shell);
                keyboard_handle.set_grab(self, grab, serial);
                let mut shell = self.common.shell.write().unwrap();
                shell.set_overview_mode(
                    Some(Trigger::KeyboardSwap(pattern, descriptor)),
                    self.common.event_loop_handle.clone(),
                );
            }
        }
    }
    

    I can’t immediately tell what that is doing, but I don’t think it’s the last window.


    I think it’s probably better to just focus on saving the active focussed window history from the compositer. It’s definitely known, they highlight the active window. Then, the alt+tab switcher could just use that history. I just have wanted to focus on other things besides trying to submit pull requests for this type of thing. I haven’t missed it that bad.

    I just took a video earlier of myself switching windows and felt really dumb doing it.

    • ericjmorey@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      13 days ago

      I was just guessing based on the SwapWindow name. That you copied definition doesn’t help me understand what it’s supposed to do.

      I’m surprised that [Super] + [Tab] and [Alt] + [Tab] aren’t exactly what you’re looking for because System(WindowSwitcher) seems like the name of something that would do exactly what you’re after.

      I haven’t installed COSMIC, so I can’t test it all out myself right now. But it feels like something that should exist as you described.

      • 3H3x36tBElshOa@feddit.nlOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        13 days ago

        In this clip I show the window switcher. It was actually that clip that motivated my post, because I felt really dumb not being able to select the history of open windows.

        edit: I didn’t read closely enough, I am surprised too. It’s given me the impression that those developing for it are maybe not using it as their primary DE. Though, then again, later in this post, I do also admit that I haven’t missed it as much as I expected.