[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Window management
From: Alex Holden ####@####.#### Date: 18 May 1999 15:46:28 -0000 Message-Id: <Pine.LNX.4.04.9905181522180.4779-100000@hyperspace> Before releasing the official Nano-X-0.5, I want to put in a basic implementation of a window management API, so that people can start writing some real window managers before the 0.6 release. The API is going to take quite a bit of design work to get right, and I'd like to try doing it on this list. I've never worked on window managers at a low level before, so I'm pretty much flying blind here. To start off, here are a few notes I've come up with: The window manager should be always be linked into the server. It should be possible to compile the server with no window manager. The window manager should have a wm_initialise() function, which returns a structure of pointers to callback functions (or NULL if that function isn't implemented). Here's a preliminary list of these functions: wm_window_create() Called with a pointer to a newly created window structure. The window manager is allowed to do things like creating a new, larger, window to contain it, along with a menu bar and iconisation, close, maximise, etc. buttons (we should probably add a new argument to GrNewInputWindow() which specifies whether the window should be resizable or not though, along with a RESIZE event. There should also be a window name argument and a GrRenameWindow() function for setting the name of the window for the top bar. There should also be "always_on_top" and "sticky" arguments). wm_window_destroy() Called with a pointer to a window to be destroyed, so the wm can destroy the parent window it created at the same time. wm_window_enter(), wm_window_leave() Called with a pointer to a window structure whenever the mouse enters a window. Used for controlling focus and depth of window. wm_window_event() Called with an event structure whenever an event needs to be delivered to a window belonging to the client with the special number belonging to the window manager. Used for redrawing the border, changing the mouse pointer when over the resize bars, sending resize events when the borders are dragged, moving the window if the top bar is dragged, closing, iconising, maximising, etc. if one of the buttons is clicked. wm_keyup(), wm_keydown() Called with a pointer to a keyboard event, whenever a keypress is detected. Should return NULL to let the event be processed and delivered, or non null if the event should be thrown away. This can be used for screen locking and hotkey processing. wm_mouseup(), wm_mousedown() Called with a pointer to a mouse event. Returns NULL to let the event be processed and delivered or non null if the event should be thrown away. Also used for screen locking. There's probably no point trapping mouse movement events though. wm_idle() Called a fixed number of times a second (10? 30?) in order for the WM to do any asynchronous processing it needs to do. In addition, we will need to add functions to Nano-X which the WM can call to: Move a window. Bring a window to the top. Ask a client to shut down. Attempt to forcibly kill a client. Set a background image. Find out how many virtual desktops there are. Switch to a different virtual desktop. (okay, we don't have virtual desktops, but it should be easy to implement, whilst still being possible to compile a version which only has one desktop and no code to handle multiple desktops). This is nowhere near complete, but I'd like comments on what is already there, and what I have missed. --------------- Linux- the choice of a GNU generation. -------------- : Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham : -------------------- http://www.linuxhacker.org/ -------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |