~jm-leddy/ubuntu/oneiric/unity-2d/unsetenvvariables

« back to all changes in this revision

Viewing changes to panel/applets/appname/windowhelper.cpp

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2011-09-29 16:58:34 UTC
  • mfrom: (1.1.24 upstream)
  • Revision ID: package-import@ubuntu.com-20110929165834-pwezbjplrigri3wf
Tags: 4.12.0-0ubuntu1
* New upstream release
  - unity-2d-panel assert failure: *** glibc detected *** unity-2d-panel:
    malloc(): smallbin double linked list corrupted: 0x08313b28 ***
    (LP: #845979)
  - unity-2d-panel assert failure: *** glibc detected *** unity-2d-panel:
    corrupted double-linked list: 0x094bc9b0 *** (LP: #852012)
  - unity-2d-panel crashed with SIGSEGV (LP: #843432)
  - Dragging downwards from the menu bar or double clicking on the menu bar
    should un-maximise the window (LP: #661049)
  - [dash] Dash is shown when pressing and releasing quickly super+KEY
    (LP: #801073)
  - [dash] Do search, scroll down using mouse, then maximise window. Layout
    breaks (LP: #817421)
  - F10 doesn't start keyboard navigation to the panel (LP: #839628)
  - [dash] Gridview moves to top when you open or close the "Show X more.."
    dropdown or the Filter pane (LP: #850036)
  - Impossible to navigate between panel menus when the mouse cursor is over
    the panel (LP: #834065)
  - [panel] F10 menu initially shown about half screen down (LP: #853766)
  - [dash] Filter pane doesn't clear its background when switching lenses
    (LP: #858590)
  - [shortcuts] <Super><Shift># should launch a new instance of #
    application (LP: #768006)
  - unity-2d-spread missing background images when path includes Unicode
    (LP: #855508)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#include <QDateTime>
43
43
#include <QApplication>
44
44
#include <QDesktopWidget>
 
45
#include <QPoint>
 
46
 
 
47
// X11
 
48
#include <X11/Xlib.h>
 
49
#include <X11/Xatom.h>
 
50
#include <QX11Info>
45
51
 
46
52
struct WindowHelperPrivate
47
53
{
157
163
    wnck_window_unmaximize(d->m_window);
158
164
}
159
165
 
 
166
void WindowHelper::drag(const QPoint& pos)
 
167
{
 
168
    // this code IMO should ultimately belong to wnck
 
169
    if (wnck_window_is_maximized(d->m_window)) {
 
170
        XEvent xev;
 
171
        QX11Info info;
 
172
        Atom netMoveResize = XInternAtom(QX11Info::display(), "_NET_WM_MOVERESIZE", false);
 
173
        xev.xclient.type = ClientMessage;
 
174
        xev.xclient.message_type = netMoveResize;
 
175
        xev.xclient.display = QX11Info::display();
 
176
        xev.xclient.window = wnck_window_get_xid(d->m_window);
 
177
        xev.xclient.format = 32;
 
178
        xev.xclient.data.l[0] = pos.x();
 
179
        xev.xclient.data.l[1] = pos.y();
 
180
        xev.xclient.data.l[2] = 8; // _NET_WM_MOVERESIZE_MOVE
 
181
        xev.xclient.data.l[3] = Button1;
 
182
        xev.xclient.data.l[4] = 0;
 
183
        XUngrabPointer(QX11Info::display(), QX11Info::appTime());
 
184
        XSendEvent(QX11Info::display(), QX11Info::appRootWindow(info.screen()), false,
 
185
                   SubstructureRedirectMask | SubstructureNotifyMask, &xev);
 
186
    }
 
187
}
 
188
 
160
189
#include "windowhelper.moc"