New windowing and input features

In my original schedule, I set next week as a target for the first Libwm release. This week I intended to write the last remaining features that go in to the release and write some documentation. I didn’t get very far with the documentation but for the coding part I had good progress. One week remaining before the release, I’d say I’m doing pretty fine. If all goes well, the release will be next week.

I started the week by improving my Extended Window Manager Hints (EWMH) code on Xlib. I also discovered a bug that caused some key press events to be duplicated. The bug originated when I was refactoring the event reading code a while ago and had gone unnoticed for a while (I really do too little testing). It took two attempts to fix the bug but now the key events work correctly.

Next I went on to add some useful input features. I started by detecting repeated keyboard events. After that, I wrote functions for warping the mouse and hiding the mouse cursor. While working on the mouse cursor I also figured out how to detect when the mouse pointer enters a window on Win32. I used TrackMouseEvent, WM_MOUSELEAVE and WM_MOUSEMOVE and a simple state machine to send MouseOverEvents and hide/show the mouse cursor to limit the effect of cursor hiding to one Window. Doing all this I found another bug. All the sudden I started getting “class already exists” errors from Win32 RegisterClassExW. I used a simple generator to make unique string identifiers from pointer addresses. The code has a simple operator precedence mistake that made my hexadecimal string conversion give same strings for different pointsrs. A pair of parens fixed the problem.

Finally I went on to add size limits to windows. Now a window can have a minimum and a maximum size and the window style is switched to make the window non-resizable if the lower and upper size limits are equal and non-zero.

Next week there won’t be any new features, only small additions and clean up. I will probably rename or add a function or two, but the coding stuff will be minimal. Most of next week’s work will probably be doing the documentation. I need to write a tutorial, building instructions for the library and a howto on using Libwm in projects. The API docs are already complete, but there’s a lot of room for improvement.

Leave a comment