Open ry755 opened 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:
graphics
object in the kernel describes an area on the screen in which drawing operations can be done safely with clipping. An initial root graphics object describes the whole screen, then child graphics objects are created from it using graphics_create
to access a subset of that screen.graphics_line
, graphics_rect
, etc, or by calling graphics_write
with a buffer full of drawing instructions described by gfxstream.h
event_queue
object is a buffer of events (mouse button, keypress, etc) to which one can post
new events, or read
events out.
window
object joins together an event_queue
and a graphics
context into a single object to which one can read
events or write
graphics in the format expected by graphics_write
.syscall_open_window
creates a kobject
of type KOBJECT_WINDOW
containing a window
object. So that when you read
or write
this object, you get either an event stream or write graphics.nwindow
interface in userspace is a small wrapper around the window object so that you can do the usual things by invoking system calls.So, if you want to have windows that can move, a couple of things need to happen:
graphics
module so that a graphics object can be resized and moved. Basically, this requires updating the object structure and copying a rectangular area on the screen. window
interface to have resize and move methods.kobject
interface to have resize and move methods.nwindow
in userspace to call those system calls.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.
Thank you so much! This clarifies a lot. I'll keep this issue open for now in case I have any other related questions.
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.
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 fornw_move()
andnw_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!