• 3H3x36tBElshOa@feddit.nlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      3 months 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
        ·
        2 months 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
          2 months 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.

          • ericjmorey@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 months ago

            I think they’re using it strictly in Tiling mode and are using directional switching. I generally work with only one window visible so I’m not sure how much I’m going to like COSMIC where that workflow seems not to be the primary focus. But it is only in alpha and I’m not actually going to give it a real try until it becomes the default in Pop!_OS. I Hope it’s not too big an adjustment for me.