← Back to team overview

dx-packages team mailing list archive

[Bug 1018215] Re: Unity launcher appearing interrupts GTK drag and drop operation (that's nowhere near the launcher)

 

I reported this as a separate bug actually, but this bug report is
better than mine. This still happens in 14.04 with
7.1.2+14.04.20131106.1-0ubuntu2

My bug report is at
https://bugs.launchpad.net/ubuntu/+source/unity/+bug/970589

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to unity in Ubuntu.
Matching subscriptions: dx-packages
https://bugs.launchpad.net/bugs/1018215

Title:
  Unity launcher appearing interrupts GTK drag and drop operation
  (that's nowhere near the launcher)

Status in Unity:
  Triaged
Status in “unity” package in Ubuntu:
  Confirmed

Bug description:
  I am a developer for an app that uses Gtk's "drag-motion" and "drag-
  leave" signals. It is important that "drag-leave" not be fired until
  the mouse actually leaves the widget. However, when running unit,
  "drag-leave" will be fired ~1 second after a drag begins.

  Here is a test project (in Vala) that reproduces the issue. Select a
  file on your desktop, and drag it to the window that this test project
  creates. You must drag it to the window within ~1 second to reproduce
  the bug. You should see "in on_drag_leave" appear in stderr, despite
  the mouse remaining within the Window.

  
  void main(string[] args) {
      Gtk.init(ref args);
      new MainWindow();
      Gtk.main();
  }

  public class MainWindow : Gtk.Window {
      private const string URI_LIST_MIME_TYPE = "text/uri-list";
      
      public MainWindow() {
          destroy.connect(Gtk.main_quit);
          set_size_request(450, 50);
          title = "Main Window";
          
          Gtk.Widget destination = new Gtk.Label("Drag a file here");
          const Gtk.TargetEntry[] target_entries = { { URI_LIST_MIME_TYPE, 0, 0 } };
          Gtk.drag_dest_set(destination, Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT,
              target_entries, Gdk.DragAction.COPY);
          destination.drag_data_received.connect(on_drag_data_received);
          destination.drag_drop.connect(on_drag_drop);
          destination.drag_leave.connect(on_drag_leave);
          add(destination);
          
          show_all();
      }
      
      private void on_drag_data_received(Gtk.Widget sender, Gdk.DragContext context, int x, int y,
          Gtk.SelectionData selection_data, uint info, uint time_) {
          
          bool dnd_success = false;
          if (selection_data.get_length() >= 0) {
              string string_data = (string)selection_data.get_data();
              stderr.printf("Received %s: '%s'\n", URI_LIST_MIME_TYPE, string_data);
              dnd_success = true;
          }
          
          Gtk.drag_finish(context, dnd_success, false, time_);
      }
      
      private bool on_drag_drop(Gtk.Widget sender, Gdk.DragContext context, int x, int y, uint time_) {
          if (context.list_targets() == null)
              return false;
          
          uint length = context.list_targets().length();
          Gdk.Atom? target_type = null;
          for (uint i = 0; i < length; i++) {
              Gdk.Atom target = context.list_targets().nth_data(i);
              if (target.name() == URI_LIST_MIME_TYPE)
                  target_type = target;
          }
          
          if (target_type == null)
              return false;
          
          Gtk.drag_get_data(sender, context, target_type, time_);
          return true;
      }
      
      private void on_drag_leave() {
          stderr.printf("in on_drag_leave\n");
      }
  }

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: unity 5.12-0ubuntu1.1
  ProcVersionSignature: Ubuntu 3.2.0-25.40-generic 3.2.18
  Uname: Linux 3.2.0-25-generic x86_64
  ApportVersion: 2.0.1-0ubuntu8
  Architecture: amd64
  CompizPlugins: [core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
  Date: Tue Jun 26 18:06:07 2012
  InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
  SourcePackage: unity
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/unity/+bug/1018215/+subscriptions