dthain / basekernel

A simple OS kernel for research, teaching, and fun.
GNU General Public License v2.0
804 stars 109 forks source link

Missing `nw_move()` and `nw_resize()` implementations #290

Open ry755 opened 11 months ago

ry755 commented 11 months ago

Hi! I am currently attempting to improve the existing window manager and make it more like what one would expect of a typical window manager. However, I quickly realized that actually moving windows around is harder than it initially seemed. include/library/nwindow.h lists prototypes for nw_move() and nw_resize() but a quick search of the rest of the codebase shows that they aren't implemented. I dug through the related code but I'm having trouble understanding how all of the different layers of the graphics stack are connected.

Do you plan on implementing these missing functions? Or if not, could you provide some guidance so I could implement them myself? Thanks!

dthain commented 11 months ago

Hello, thanks for your interest, happy to have some new contributions. To get this will require some changes that cut across various kernel objects. Let me see if I can clarify how a few things work:

So, if you want to have windows that can move, a couple of things need to happen:

Now, note that the userspace manager program isn't really a window manager in the sense that we might understand that term in Linux. It is a very simple program that just invokes N other programs and gives each one a window. If you want to make that more interactive, you could modify it to capture certain keystrokes and translate those into selecting and resizing windows.

Hope that clarifies things.

ry755 commented 11 months ago

Thank you so much! This clarifies a lot. I'll keep this issue open for now in case I have any other related questions.

dthain commented 11 months ago

FYI, I made some recent changes that fix a few compilation issues and kernel crashes that arose in relation to the window manager. You might want to pull the latest.