[Thread Prev][Thread Next]   >Date Index >Thread Index

[wmx] New feature (kludged already)

Damion Yates - Mon Sep 10 14:38:10 2001

Hi, a while back I was asking about an addition (gosh no!) to the
minimalistic functionality of wmx, that I felt would not be adding bloat and
would keep in line with the nature of wmx in the way it feels to use.

This feature is the ability to move a window by just holding the chosen meta
key down while dragging with the left mouse button, from anywhere within a
window not just the border.  Thus not limiting you to finding the often small
left tag with your mouse and also allowing windows to be shoved up to the top
left beyond their borders with ease.

This feature exists in most other window managers and is something that won't
effect the code size or minimalistic nature of wmx.

In fact I implemented it in a kludgey way a few months back and have been
using it ever since putting up with a few minor bugs.  I should point out
that I did C++ at uni 7 years ago and I'm VERY out of practice at programming
like this, it took me quite a while to get used to the OO structure, once I
did it made loads of sense and I had quite a feeling for what I was doing,
having fun disabling various features with a simple commenting out :)  I had
some problems with the structure of the choice of which file had which object
defined but perhaps that's just a C++'ism I'd forgotten.

I call this a kludge because I cheated in one rather specific thing and also
because I worked around another issue with a nasty work around.  I stopped
and didn't unkludge it for two reasons.

1) I use the mod mask rather than a key code, I think this would have worked
with the older wmx but at some point it was changed.  I happen to use Alt as
my meta key and once I'd got it working like this I stopped as it was exactly
what I wanted.  To sort this I'd need to pass a flag of the status of the
meta-key through to the right object layer or something, because IIRC only
certain objects will know and there needs to be a public interface between
them?  My OO coding is way out of practice, plus this was months ago, the
main reason I stopped is because I couldn't be bothered and I'd fixed it for
me ;)  Now I want to share what I've done it's hit me back.  This might be
the cause of one of the minor bugs where it writes to the console "wmx: Alt
key record in inconsistent state" every now and again.

2) When I've picked up the window and start to drag the mouse I noticed it
jumped the window down diagonally, I put up with it for a while, but then got
annoyed and tried to fix it.  I couldn't work out how so kludged it by
warping the mouse up instead, this is less visible and means the window moves
from where you expect, but it limits how high you have push a window and is a
nasty kludge.

The additions took me a day or so, but most of this was just familiarising
myself with the way wmx and X (never done X coding before) worked.  Then it
was about 10 lines of code scattered around.  I also took the opportunity to
lower some of the values used when resizing/dragging windows around, I assume
these are polling intervals, these should be in Config.h or perhaps
dynamically created based on the speed of your system.  With lower values
everything moves _really_ smoothly!  My desktop isn't exactly speedy (cpu0:
SUNW,UltraSPARC-IIi (upaid 0 impl 0x12 ver 0x12 clock 300 MHz)) but I haven't
seen any negative effects from this change, so it looks like the default was
too large.

Anyway, I'm sending this email to see if anyone is interested in taking the
code and making it a proper fix?  Or at least if somebody can explain how to
better sort the jumping problem I'm getting, I can live with the mod mask
kludge my own use and the stderr message can be commented out ;).


Damion Yates - Senior Internet Operations Engineer - Internet Services
email: Damion.Yates@bbc.co.uk - phone: +44 1737 839510