avahe-kellenberger / nimdow

A window manager written in Nim (In Development)
GNU General Public License v2.0
319 stars 19 forks source link

Add scratchpad #150

Closed uninhm closed 3 years ago

uninhm commented 3 years ago

I'm not sure if that's exactly how "scratchpad" should work, but it's an advance.

uninhm commented 3 years ago

133

uninhm commented 3 years ago

https://github.com/avahe-kellenberger/nimdow/pull/150/commits/2b1a64ce24326881dabcf0fdae2a39f6fbac944a

Using for loop isn't beauty, if you know how to do it better please let me know

Edit: I found the function for that, will change it tomorrow

avahe-kellenberger commented 3 years ago

Been out the past few days but I'll be checking your PRs and issues this week. Thanks for contributing!

uninhm commented 3 years ago

Should I create scratchpad.nim file, with a Scratchpad type and some procs like popFirstClient, popLastClient and addClient?

avahe-kellenberger commented 3 years ago

That sounds like a good idea, just wrapping some procs from deques

avahe-kellenberger commented 3 years ago

I'm not sure about the desired behavior either (never used a scratchpad) but it does seem odd to me that a non-floating window becomes floating.

@dakyskye Could you chime in with your experience here, and/or opinions on the matter?

dakyskye commented 3 years ago

As I see you save the geometry of a window before throwing it to the scratchpad but that causes some issues later on (for example, if you scratchpaded the only window in a tag, then opened a master and a couple of slave windows and retained the scratchpaded window, it'd spawn on top of all of them).

I think you should only save the state of a window, not the geometry.

uninhm commented 3 years ago

Ok, so... 1) If window is tiled, recover resized in the center 2) If window is floating, recover as it was before pushing to scratchpad

avahe-kellenberger commented 3 years ago

@uninhm Still plan on getting this PR merged? I can assist with any issues you may have

uninhm commented 3 years ago

I think it's ready