Home » Developing U++ » U++ Developers corner » Stupid X11 Xdnd problem...
Stupid X11 Xdnd problem... [message #9785] |
Wed, 30 May 2007 13:40 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Situation: Dropping files onto application.
The problem here is that dropping files should accept file no matter on which widget it is dropped.
Anyway, it would be extremely tedious to make any widget a target for file drop.
Therefore, while working on this in Win32, if child does not accept the drag, it goes recursively up via ChildDragAndDrop method, until it is either accepted or top ctrl is reached.
So far so good, this made D&D of files easily implementable, in Windows (see examples/UWord).
However, in X11 this approach fails, because Gnome file manager puts the file list in several formats (besides "text/uri-list" which is the format for file lists), including STRING and STRING_UTF8 -> these are accepted by all U++ text editors. Means child widget wrongly eats the drop and it never gets to its parent.
I see two possible solution, but at the moment like neither:
- reverse ChildDragAndDrop call order -> it would be called for the top-level Ctrl first and then for childs until DragAndDrop for final widget is called
- handle this situation by supressing all other text formats if text/uri-list is present (but this might reduce the usability of some applications).
Any thoughts?
Mirek
|
|
|
|
Re: Stupid X11 Xdnd problem... [message #9787 is a reply to message #9786] |
Wed, 30 May 2007 14:06 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
mrjt wrote on Wed, 30 May 2007 07:48 | Both of these could concievably break some applications, and being able to drag flies into text editors can be a nice feature. Perhaps a third solution:
- A bottom up pass with text/uri-list, if nothing accepts it then repeat with text formats
Or is this too complicated?
|
I think this is unsystematic. From the basic interface point of view, are formats are equal, eventual priority should be achieved by call ordering (just like it is for keys).
I am starting to lean towards top-bottom call ordering. It can hardly break any applications (there are only 2 at the moment, uWord and TheIDE, and both will work OK with this).
Perhaps there is some logic in this: Application is more likely to know about special formats, whereas CtrlLib widgets are not.
In fact, thinking about it even more, maybe it should even be regular DragAndDrop event (not ChildDragAndDrop), going up->down. It starts to make sense to me...
|
|
|
Goto Forum:
Current Time: Mon Apr 29 01:51:51 CEST 2024
Total time taken to generate the page: 0.02900 seconds
|