Giter Club home page Giter Club logo

Comments (6)

sminez avatar sminez commented on May 20, 2024

Are you able to give me the hash that this was last working on? It would also really help if you can put some logging into your hook and determine exactly when it is exiting. Looking over the code you have provided there are quite a few places where you could be exiting early.

from penrose.

crypt17 avatar crypt17 commented on May 20, 2024

from penrose.

sminez avatar sminez commented on May 20, 2024

@crypt17 I've rewritten your hook a bit to make it easier to reason about and added some simple print logging to trace the execution:

struct RmClientHook {}
impl Hook for RmClientHook {
    fn remove_client(&mut self, wm: &mut WindowManager, _: WinId) {
        if let Some(ws) = wm.workspace(&Selector::Focused) {
            println!("have focused workspace: {}", ws.name());
            if ws.len() > 1 {
                println!("more than one client (n={})", ws.len());
                let last = wm.client(&Selector::Index(ws.len() - 1));
                if last != wm.client(&Selector::Focused) {
                    println!("new focused is not last");
                    wm.cycle_client(Backward);
                }
            }
        }
    }
}

From what I can see, this is firing (yours was as well) and cycle_client is being called. cycle_client is also doing the right thing. When using a layout that does not trigger on a focus change it works fine but it results in an infinite loop of cycling clients for the example paper layout config. Working around that is something that you'll need to handle in your hook if this is how you are wanting to implement it.

from penrose.

crypt17 avatar crypt17 commented on May 20, 2024

from penrose.

crypt17 avatar crypt17 commented on May 20, 2024

from penrose.

sminez avatar sminez commented on May 20, 2024

This behaviour is a breaking change for layouts that follow focus. It will not be added to core. If you want to implement it as am extension as already discussed then feel free to do so.

from penrose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.