More DND
- From: Drazen Kacar <dave srce hr>
- To: gtk-list redhat com
- Subject: More DND
- Date: Sun, 21 Mar 1999 12:48:04 +0100
Some time ago I had a problem with DND. Top level window was registered
as a drop site, but it wasn't receiving drag_leave events if the pointer
went from the application window to the root window. When it got over
any other window, my app receives it, but it's too late, since I want
to have a different pixmap in the window when the DND action is occuring.
In the meantime I've identified the problem and it's called Window
Maker's sloppy focus. When the pointer goes from my application to the
root window, it still has the focus, so it doesn't receive drag_leave
event. I don't know if this is a bug (and if it is, whether it's in
GTK or Window Maker).
Anyway, I tried to put event box in the top level window and to register the
event box as a drop site, but that wasn't very successful. It works
if I don't move the pointer too fast, probably because there's not
many pixels between two two windows. I suppose I could increase the
border width, but the application in question is a Window Maker dock
applet, so pixels are a precious resources which I wouldn't waste
lightly.
Another problem with this approach is that I've lost transparency. Since
it's a dock applet, I was using shaped window, so I could have a default
icon background from Window Maker. I don't have control over it, since it
depends on theme which is currently in use. With two windows (top level
and the event box) the gray area belonging to the top level window is
displayed instead of normal icon background and that looks very
ugly.
I'd be grateful if anyone has any kind of suggestion. Perhaps there is
a way to ask for a transparent top level window?
On a related matter, would there be a way for the drop site widget to
change the icon which is being dragged by the user? I actually need
to remove it from the screen, but changing to 1x1 bitmap would be acceptable.
The only purpose of the application is to receive URL drops and to start
downloading in the background. So it usually displays "inactive" icon.
When it receives drag_motion, it starts displaying "active" icon. When
it receives drag_drop event, it changes icon again to, let's call it
"gotcha" icon. But then Motif performs its blend in with the icon that
the user was dragging and my "active" icon. Since at that time I don't
have "active" icon on the screen any more, this looks rather stupid.
IIRC, Motif DND API has a way for a destination site to change the icon
which is being dragged, so the drop site can give a visual feedback
to the user. I'd also like to know if I can obtain drag data when I'm
in the drag_motion callback, because I'd like to use yet another icon if
my application won't accept the data. It's only a simple text, so I'm
not concerned about complex data types.
--
.-. .-. Life is a sexually transmitted disease.
(_ \ / _)
| dave@srce.hr
| dave@fly.cc.fer.hr
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]