TimUntersberger / nog

A tiling window manager for Windows
MIT License
697 stars 20 forks source link

Improve hot reloading #277

Closed TimUntersberger closed 3 years ago

TimUntersberger commented 3 years ago

edge cases:

todo

TimUntersberger commented 3 years ago

@ramirezmike I am currently trying to redraw all visible grids, but I can't find a way to do this.

this is how I am doing it right now.

                    "use_border" => set_prop!(use_border, bool, |old, new, _| {
                        if old != new {
                            state.each_window(|w| {
                                if new {
                                    w.add_border()
                                } else {
                                    w.remove_border()
                                }
                            }).unwrap();

                            state.config.use_border = new;
                            for d in &state.displays {
                                // this doesn't work
                                if let Some(g) = d.get_focused_grid() {
                                    d.refresh_grid(&state.config).unwrap();
                                }
                            }
                        }
                    }),

This is the branch of a match statement. It basically modifies the window style of all managed windows based on the new value and then it should redraw the visible grids.

ramirezmike commented 3 years ago

I'll try to take a closer look later tonight but you shouldn't need this part wrapping the call

                                if let Some(g) = d.get_focused_grid() {
                                }

because refresh_grid handles that. I don't think it would hurt but... it shouldn't be necessary. I would look to see if the display struct's focused_grid_id is not None.

ramirezmike commented 3 years ago

is this waiting on something or can it be merged?

TimUntersberger commented 3 years ago

I don't really remember why I didn't merge this 🤔

Will merge this and hope I didn't forget about anything.