After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578249 - Drag and drop of video on itself restarts it
Drag and drop of video on itself restarts it
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Movie player
2.26.x
Other All
: Normal minor
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
: 583941 584229 590475 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-07 14:46 UTC by Adam Klobukowski
Modified: 2009-08-01 19:04 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
proposed patch (2.15 KB, patch)
2009-04-20 22:20 UTC, Robin Stocker
committed Details | Review

Description Adam Klobukowski 2009-04-07 14:46:32 UTC
It is possible to drag by inititating drag&drop action with Totem (by clicking on Totem window while playing). This sometimes happens when you just click on the window. Now, if the dragged item is dropped back on Totem, it, Totem restarts playing from the beginning. This is annying.

Summary if Totem is activator and beneficient of the d&d, it should not restart the movie.

Other information:
Comment 1 Robin Stocker 2009-04-09 10:50:49 UTC
Yes, happened to me too when I wanted to double-click the video for fullscreen and my mouse pointer slipped a bit.

I have a patch which does nothing when the video window is dragged onto itself. I'll post it as soon as I can build totem again and test it (have to upgrade gtk+).
Comment 2 Robin Stocker 2009-04-20 22:20:18 UTC
Created attachment 132993 [details] [review]
proposed patch

This patch fixes the problem by ignoring the drop when the source_window of the drop is the same as the drag one.

It would be a cleaner fix if we didn't have to store context->source_window. But I couldn't figure out what the source_window really is (it's not bvw, it's not totem->win). Does anyone have an idea?
Comment 3 Philip Withnall 2009-04-20 22:49:23 UTC
(In reply to comment #2)
> It would be a cleaner fix if we didn't have to store context->source_window.
> But I couldn't figure out what the source_window really is (it's not bvw, it's
> not totem->win). Does anyone have an idea?

It's a GdkWindow, so I suspect it's going to be gtk_widget_get_window (bvw) or gtk_widget_get_window (totem->win).

Comment 4 Robin Stocker 2009-04-21 21:48:34 UTC
(In reply to comment #3)
> It's a GdkWindow, so I suspect it's going to be gtk_widget_get_window (bvw) or
> gtk_widget_get_window (totem->win).

Hm, I tried that, but here's what I get in drop_video_cb:

  context->source_window: 0x8c7ef20
  context->dest_window: 0x8acf198
  gtk_widget_get_window (totem->bvw): 0x8c25640
  gtk_widget_get_window (totem->win): 0x8acf198

Maybe it's a GdkWindow the BVW uses internally or something like that?
Comment 5 Philip Withnall 2009-04-21 21:56:36 UTC
(In reply to comment #4)
> Maybe it's a GdkWindow the BVW uses internally or something like that?

Might be bvw->priv->video_window, which would be awkward.

Comment 6 Bastien Nocera 2009-04-21 22:04:33 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Maybe it's a GdkWindow the BVW uses internally or something like that?
> 
> Might be bvw->priv->video_window, which would be awkward.

Robin's solution is probably good enough for 2.26.

Didn't your patch for GSEAL stuff remove the internal ->video_window?
Comment 7 Philip Withnall 2009-04-21 23:20:32 UTC
(In reply to comment #6)
> Didn't your patch for GSEAL stuff remove the internal ->video_window?

It wasn't my patch, and it only stopped us creating the widget's GdkWindow (the creation was moved to the parent class' realization function) — bvw->priv->video_window still exists. (Quite why I have no idea.)

Comment 8 Robin Stocker 2009-04-24 10:33:07 UTC
It's not bvw->priv->video_window either:

  bvw->priv->video_window: 0x1cb3f00
  context->source_window: 0x29f5be0
  context->dest_window: 0x1bff3c0
  gtk_widget_get_window (totem->bvw): 0x1cb3dc0
  totem->win: 0x1b026c0

It might be worth a try to remove bvw->priv->video_window and use the widget's window directly, maybe then context->source_window is something we know. That's what I'm going to try next.
Comment 9 Philip Withnall 2009-05-26 21:24:02 UTC
*** Bug 583941 has been marked as a duplicate of this bug. ***
Comment 10 Philip Withnall 2009-05-29 22:00:58 UTC
*** Bug 584229 has been marked as a duplicate of this bug. ***
Comment 11 Bastien Nocera 2009-07-15 13:15:08 UTC
Any news Robin? If not, feel free to commit the current patch with some additional comments in the struct.
Comment 12 Robin Stocker 2009-07-15 16:36:14 UTC
bvw->priv->video_window is used for the zoom functionality, so it can't be removed. I couldn't find the window that is the drag and drop source.

I also tried setting GTK_TARGET_OTHER_WIDGET but that didn't work either (maybe because of the same underlying reason).

So, I'll commit this patch.
Comment 13 Robin Stocker 2009-07-16 07:55:23 UTC
Committed to master and pushed. Should I also commit it to gnome-2-26?
Comment 14 Bastien Nocera 2009-07-16 13:35:08 UTC
(In reply to comment #13)
> Committed to master and pushed. Should I also commit it to gnome-2-26?

Yes please
Comment 15 Robin Stocker 2009-07-17 08:18:31 UTC
Done!
Comment 16 Philip Withnall 2009-08-01 19:04:57 UTC
*** Bug 590475 has been marked as a duplicate of this bug. ***