Re: Problem with Treeview drag and drop
Glade sets the POINTER_MOTION_HINT_MASK by default. With that flag set, GTK produces only one motion-notify event on pointer motion. Pretty much kills DnD. If Nokia had an FAQ, this tip could go in it. It's strange that GTK seems to ignore the mask in an empty treeview. -- Jeffrey Barish ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Problem with Treeview drag and drop
Here's more: When I remove all items from the treeview, motion-notify event works again. As long as there is an item in the treeview, I get only button-press and one motion-notify. I tried catching the event signal. With an item present in the treeview, I am not getting any other events either after the first motion-notify signal. Here's the exact sequence of events when I tap and trace in an open area with an item present in the treeview: event = event position (no button1_mask) = 224 281 event = event = event = START position = 224 281 event = event position = 224 281 event = Notice that the first event is a motion-notify that I didn't know about because there was no button1_mask. The second motion-notify is the one I knew about. Apparently the first motion-notify event is associated with the change in position from where the previous actions left off and the present ones began. I also noticed that there is no button-release at the end of the drag that moved the item into the treeview (which immediately preceded the sequence above). With no item in the treeview, I get this sequence of events: event = event position (no button1_mask) = 39 337 event = event = event = START position = 39 337 event = event position = 38 338 ... other MOTION_NOTIFY events ... event = No difference, except that with an item present I get only the one motion-notify event. The only anomaly I'm seeing is that there is no button-release event on completion of the drag. -- Jeffrey Barish ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Problem with Treeview drag and drop
As I reported a month ago, I am having a problem with Treeview drag and drop. I am not able to pick up a row unless I trace out of the treeview. I discovered something interesting today. I am catching motion-notify-event and printing out the position of the event. I observe that with a fresh treeview, I get a barrage of new event positions as I move the stylus in the treeview -- as expected. Then I drag a row from another treeview and drop it in the treeview in question. At that point, tracing on the remaining open space elicits exactly two events, the initial tap and one motion event. If I am aggressive, I can sometimes move the stylus quickly enough that the one motion event is far enough from the initial tap to trigger the drag. It's clear that I can't pick up a row because gtk is not registering stylus movement -- until I move it out of the treeview. But why would it happen that I would stop receiving motion events after dropping into the treeview? I do not get this behavior when I run the program on Ubuntu. Can anyone suggest a way to "reset" the treeview so that it starts receiving motion events again? Here's more: The drag from the source treeview doesn't start until the stylus exits the treeview. I investigated further and discovered that the same problem occurs there. So it isn't just dragging something into the treeview that initiates the problem, it's also writing something into the treeview programmatically. A test program that I wrote does not demonstrate the problem, so it seems that something is wrong with my code, but I am at a loss as to what to look for. Moreover, if something is wrong with my code, it seems odd that it works fine on Ubuntu. -- Jeffrey Barish ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Treeview drag and drop
Owen Williams wrote: > I find I have to tape and select the item, then tap and hold to get it > to drag and drop. If I tap to select and immediately start dragging, I > get the multi-select thing. No, actually for me it works fine to drag at the same time that I select, but the drag still doesn't register until I leave the widget where the drag started. The behavior is the same whether or not the item (a row in a treeview) was selected first. > If your treeview does not have multiselect, that sounds like a gtk bug. My treeview does not have multiselect. The mode of the treeview is the default SELECTION_SINGLE. I tried activating the drag explicitly using drag_begin in a motion_notify handler and also implicitly without such a handler. I presume that the implicit method uses the same drag_check_threshold, so it isn't surprising that I observe the same behavior in both cases. I think that there is something wrong with the way drag_check_threshold works on maemo. I had the idea that I should write my own drag_check_threshold. I learned that I get one event when I first tap. When I then drag the stylus, I get no more events until I leave the treeview. I have GDK_BUTTON_MOTION_MASK set (in Glade), so I expect to receive a barrage of events when I move the stylus. I also expect that the distance of the first tap will always be 0, but it is not. Often it is 0, sometimes it is a small number (e.g., 1-3), and rarely it is a large number (e.g., 14.0, 39.1). If I set my threshold to > 0.0, then I am sometimes able to initiate a drag without tracing to a point outside the treeview. -- Jeffrey Barish ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Treeview drag and drop
I find I have to tape and select the item, then tap and hold to get it to drag and drop. If I tap to select and immediately start dragging, I get the multi-select thing. If your treeview does not have multiselect, that sounds like a gtk bug. owen On Mon, 2008-08-25 at 10:23 -0600, Jeffrey Barish wrote: > I have a treeview in which it is possible to reorder rows by drag and drop. > (It is also possible to drag a row into the treeview from another > treeview.) It all works fine on Ubuntu, but on maemo I find that to drag a > row from the treeview in question to itself, I have to move the stylus to a > point outside the treeview before the movement registers as a drag. Any > movements confined to the treeview itself will not trigger the drag. I > suppose that there must be a problem with drag_check_threshold. Has anyone > else has observed this behavior? Is there a workaround? ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Treeview drag and drop
Hi, ext Jeffrey Barish wrote: > I have a treeview in which it is possible to reorder rows by drag and drop. > (It is also possible to drag a row into the treeview from another > treeview.) It all works fine on Ubuntu, but on maemo I find that to drag a > row from the treeview in question to itself, I have to move the stylus to a > point outside the treeview before the movement registers as a drag. Any > movements confined to the treeview itself will not trigger the drag. I > suppose that there must be a problem with drag_check_threshold. Has anyone > else has observed this behavior? Is there a workaround? I guess this could be because it conflicts with the drag multiselection interaction (you can try it in file manager). - Eero ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Treeview drag and drop
I have a treeview in which it is possible to reorder rows by drag and drop. (It is also possible to drag a row into the treeview from another treeview.) It all works fine on Ubuntu, but on maemo I find that to drag a row from the treeview in question to itself, I have to move the stylus to a point outside the treeview before the movement registers as a drag. Any movements confined to the treeview itself will not trigger the drag. I suppose that there must be a problem with drag_check_threshold. Has anyone else has observed this behavior? Is there a workaround? -- Jeffrey Barish ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers