Back to index

unity  6.0.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
unity::DNDCollectionWindow Class Reference

DNDCollectionWindow makes it possible to collect drag and drop (dnd) data as soon as dnd starts and not when the mouse pointer enter the x window. More...

#include <DNDCollectionWindow.h>

Collaboration diagram for unity::DNDCollectionWindow:
Collaboration graph

List of all members.

Public Member Functions

 DNDCollectionWindow ()
 ~DNDCollectionWindow ()
void Collect ()

Public Attributes

nux::Property< Display * > display
sigc::signal< void, const
std::list< char * > & > 

Private Member Functions

 NUX_DECLARE_OBJECT_TYPE (DNDCollectionWindow, nux::BaseWindow)
void ProcessDndMove (int x, int y, std::list< char * > mimes)
void OnWindowMoved (guint32 xid)
 EnableInputWindow doesn't show the window immediately.

Private Attributes

std::list< char * > mimes_

Detailed Description

DNDCollectionWindow makes it possible to collect drag and drop (dnd) data as soon as dnd starts and not when the mouse pointer enter the x window.

Definition at line 36 of file DNDCollectionWindow.h.

Constructor & Destructor Documentation

Definition at line 27 of file DNDCollectionWindow.cpp.

  : nux::BaseWindow("")
  , display(NULL)
  // Make it invisible...
  // ... and as big as the whole screen.
  // Hack to create the X Window as soon as possible.
  EnableInputWindow(true, "DNDCollectionWindow");
  EnableInputWindow(false, "DNDCollectionWindow");
  SetDndEnabled(false, true);
  WindowManager::Default()->window_moved.connect(sigc::mem_fun(this, &DNDCollectionWindow::OnWindowMoved));

Here is the call graph for this function:

Definition at line 47 of file DNDCollectionWindow.cpp.

  for (auto it : mimes_)

Member Function Documentation

Definition at line 69 of file DNDCollectionWindow.cpp.

  // Using PushToFront we're sure that the window is shown over the panel window,
  // the launcher window and the dash window. Don't forget to call PushToBack as
  // soon as possible.
  EnableInputWindow(true, "DndCollectionWindow");
void unity::DNDCollectionWindow::OnWindowMoved ( guint32  xid) [private]

EnableInputWindow doesn't show the window immediately.

Since nux::EnableInputWindow uses XMoveResizeWindow the best way to know if the X Window is really on/off screen is receiving WindowManager::window_moved signal. Please don't hate me!

Definition at line 59 of file DNDCollectionWindow.cpp.

  if (xid == GetInputWindowId() && display() != NULL)
    // Create a fake mouse move because sometimes an extra one is required.
    XWarpPointer(display(), None, None, 0, 0, 0, 0, 0, 0);

Here is the caller graph for this function:

void unity::DNDCollectionWindow::ProcessDndMove ( int  x,
int  y,
std::list< char * >  mimes 
) [private]

Definition at line 78 of file DNDCollectionWindow.cpp.

  // Hide the window as soon as possible.
  EnableInputWindow(false, "DNDCollectionWindow");
  // Free mimes_ before fill it again.                       
  for (auto it : mimes_)

  // Duplicate the list.
  for (auto it : mimes)
  // Emit the collected signal.

Member Data Documentation

sigc::signal<void, const std::list<char*>&> unity::DNDCollectionWindow::collected

Definition at line 55 of file DNDCollectionWindow.h.

nux::Property<Display*> unity::DNDCollectionWindow::display

Definition at line 53 of file DNDCollectionWindow.h.

std::list<char*> unity::DNDCollectionWindow::mimes_ [private]

Definition at line 58 of file DNDCollectionWindow.h.

The documentation for this class was generated from the following files: