Community
Participate
Working Groups
on Windows, if you attach a dragdetect listener, you'll get one fewer selection event. In control example, go to the sash tab - attach mousedown, mouseup, and selection listeners. - press down and up on a sash. you'll get the following events: Selection: SelectionEvent{Sash {} time=604321406 data=null item=null detail=1 x=0 y=144 width=563 height=3 stateMask=0 doit=true} MouseDown: MouseEvent{Sash {} time=604321406 data=null button=1 stateMask=0 x=180 y=2} Selection: SelectionEvent{Sash {} time=604321484 data=null item=null detail=0 x=0 y=144 width=563 height=3 stateMask=0 doit=true} MouseUp: MouseEvent{Sash {} time=604321484 data=null button=1 stateMask=524288 x=180 y=2} Now attach a dragdetect listener, in addition to the ones above and again click on the sash You'll get the following events: Selection: SelectionEvent{Sash {} time=604335578 data=null item=null detail=1 x=0 y=144 width=563 height=3 stateMask=0 doit=true} MouseDown: MouseEvent{Sash {} time=604335578 data=null button=1 stateMask=0 x=251 y=2} MouseUp: MouseEvent{Sash {} time=604335578 data=null button=1 stateMask=524288 x=251 y=2} Notice the second selection is missing. Gtk and motif record the same events as the first case whether dragdetect is attached or not.
A similar things happens for scale. With mousedown, mouseup and selection attached, click on the thumb You'll get the following events: Selection: SelectionEvent{Scale {} time=608545937 data=null item=null detail=0 x=0 y=0 width=0 height=0 stateMask=0 doit=true} MouseDown: MouseEvent{Scale {} time=608545937 data=null button=1 stateMask=0 x=72 y=18} Selection: SelectionEvent{Scale {} time=608546046 data=null item=null detail=0 x=0 y=0 width=0 height=0 stateMask=0 doit=true} MouseUp: MouseEvent{Scale {} time=608546046 data=null button=1 stateMask=524288 x=72 y=18} If dragdetect is also attached, and the thumb clicked, you'll get the following events: Selection: SelectionEvent{Scale {} time=608591921 data=null item=null detail=0 x=0 y=0 width=0 height=0 stateMask=0 doit=true} Selection: SelectionEvent{Scale {} time=608591921 data=null item=null detail=0 x=0 y=0 width=0 height=0 stateMask=0 doit=true} MouseDown: MouseEvent{Scale {} time=608591921 data=null button=1 stateMask=0 x=72 y=17} MouseUp: MouseEvent{Scale {} time=608591921 data=null button=1 stateMask=524288 x=72 y=17} Though an event isn't lost, the order of events is switched.
fixed > 20041217 fake mouseup in Widget.wm_lbuttondown is now sent using OS.PostMessage
This caused bug 81759.
Grant to prioritize.
I've verified that this is working now, it should have been marked as FIXED just before Christmas.
I don't remember fixing this, especially for a sash ... and we put back the SendMessage() in WM_LBUTTONUP because this broke tool bars. Billy?
I see the original problem again, and now cheese is left on the sash once the DragDetect has been hooked.
Possible fix: On most widgets, this can easily be fixed by NOT using OS.DragDetect, but rather emulating the drag-detection from WM_LBUTTONDOWN/UP, WM_MOUSEMOVE and WM_KEYDOWN. In fact, this is fairly simple to do, since all that has to be done is detect WM_MOUSEMOVE outside of a GetSystemMetrix(SM_CX/YDRAG) box between a WM_LBUTTONDOWN and WM_LBUTTONUP/WM_KEYDOWN(wParam=VK_ESC), then send the dragdetect to the position where the WM_LBUTTONDOWN occurred. Two possible issues: 1. I don't have WinCE, so I can't be sure, is the behavior there the same? 2. Some widgets call DragDetect from the window proc, so some prevention may be in order there. Alternately, allow these to be handled as they are, since they use a completely overridden WM_LBUTTONDOWN anyway, and don't bare the same functionality as a Sash.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it and remove the stalebug whiteboard tag. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.