pho! The code is much cleaner now -- images are stored as structs in a linked list, no more motley collections of weird global arrays. Code is factored better, and it builds for gtk2. But the main motivation for rewriting it was to have it make a new window for each new or resized image, replacing the old window, to solve a bunch of window manager bugs I keep hitting:
- Some window managers (kwm, xfce4) don't correctly resize a small window to be bigger, or if they do, the contents of the bigger window only repaint over the area that was covered by the old size.
- Some window managers (xfce4, openbox) under pointer focus will lose window focus if a window is resized or moved to a place where it's no longer under the mouse, even if the window had focus before.
I handed the new pho to Dave for testing, and he hates the "new window each time" model; it takes too long in the window managers he runs. He says he wasn't that bothered by the repainting/resizing problems.
Fortunately, the rewrite factored the code so that it should be easy to provide both options (that was the plan anyway), isolated in the NewWindow routine. So I'll put back the "resize and reposition existing window" code, as a switchable option, and maybe try to grab focus to solve the pointer focus issues that have been plaguing me. I don't know what to do about the window manager resize/repaint issues; more research is required.
[ 23:00 Jul 07, 2004 More programming | permalink to this entry | ]