~ubuntu-branches/ubuntu/vivid/compiz/vivid

« back to all changes in this revision

Viewing changes to src/window.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Chris Townsend, Marco Trevisan (Treviño)
  • Date: 2014-06-06 09:43:06 UTC
  • mfrom: (3248.176.39)
  • Revision ID: package-import@ubuntu.com-20140606094306-pbrwu3aaaafox0z2
Tags: 1:0.9.11+14.10.20140606-0ubuntu1
[ Chris Townsend ]
* Only ungrab the Mod2Mask modifier on buttons 4-7 to allow scrolling
  in unfocused Gtk windows while still allowing keybinding modifiers
  to other scroll wheel actions. (LP: #1311788)
* Fix issue where window decorations would be placed under the Panel
  when opening a new window from an already open window. This is due
  to the already open window being taller or just as tall without be
  maximized than the workspace. (LP: #1303462)
* Only constrain the non-modifier scrolling to the vertical scrolling
  buttons - buttons 4 & 5. (LP: #1311303)
* Fix issue where maximized windows would get moved to different
  workspaces when disconnecting/connecting an external monitor.
  Windows should stay in the same workspace they are in when the
  monitor event occurs. (LP: #1304531)
* Fix issue where custom keyboard shortcuts would get reset to
  defaults when rebooting or restarting Compiz. (LP: #1063617)
* Fixes issue in the Expo plugin where a gap is shown in the place
  where the Launcher and Panel should be when windows are maximized.
  This was originally removed in rev. 3481. (LP: #1087090)
* Fix issue where horizontal and vertical keyboard resizing could not
  happen at the same time. (LP: #347390)

[ Marco Trevisan (Treviño) ]
* Scale: use XShape extension to exclude dnd input in the screen-parts
  outside workArea This will work property also in multi-monitor,
  without requiring multiple X windows for each output device. Also
  don't terminate the scale unless a drag-n-drop action is not really
  over. Add a spinner that shows up over a window, during the DnD
  timeout. Plus, make sure we terminate the scale without focusing the
  selected icon when cancelling it and some code cleanup (LP: #607796)
* Event: set the screen grabbed also when we get a NotifyWhileGrabbed
  Focus{In,Out} event (LP: #1305586)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3553
3553
    int       mask = 0;
3554
3554
    CompPoint viewport;
3555
3555
 
3556
 
    if (old.intersects (CompRect (0, 0, screen->width (), screen->height ())))
 
3556
    if (old.intersects (CompRect (0, 0, screen->width (), screen->height ())) && 
 
3557
        !(state & CompWindowStateMaximizedHorzMask || state & CompWindowStateMaximizedVertMask))
3557
3558
        viewport = screen->vp ();
 
3559
    else if ((state & CompWindowStateMaximizedHorzMask || state & CompWindowStateMaximizedVertMask) &&
 
3560
             window->moved ())
 
3561
        viewport = initialViewport;
3558
3562
    else
3559
3563
        screen->viewportForGeometry (old, viewport);
3560
3564
 
 
3565
    if (viewport.x () > screen->vpSize ().width () - 1)
 
3566
        viewport.setX (screen->vpSize ().width () - 1);
 
3567
    if (viewport.y () > screen->vpSize ().height () - 1)
 
3568
        viewport.setY (screen->vpSize ().height () - 1);
 
3569
 
3561
3570
    int x = (viewport.x () - screen->vp ().x ()) * screen->width ();
3562
3571
    int y = (viewport.y () - screen->vp ().y ()) * screen->height ();
3563
3572
 
4021
4030
 
4022
4031
    if (placed)
4023
4032
        priv->placed = true;
 
4033
 
 
4034
    priv->initialViewport = defaultViewport ();
4024
4035
}
4025
4036
 
4026
4037
bool
4674
4685
    if (overrideRedirect ())
4675
4686
        return;
4676
4687
 
 
4688
    priv->initialViewport = screen->vp ();
 
4689
 
4677
4690
    state = constrainWindowState (state, priv->actions);
4678
4691
 
4679
4692
    state &= MAXIMIZE_STATE;
5637
5650
 
5638
5651
        if (!(priv->type & CompWindowTypeDesktopMask))
5639
5652
        {
5640
 
            /* Ungrab Buttons 4-7 for scrolling if the window is not the desktop window */
5641
 
            for (int i = 4; i <= 7; i++)
5642
 
                XUngrabButton (screen->dpy (), i, AnyModifier, frame);
 
5653
            /* Ungrab Buttons 4 & 5 for vertical scrolling if the window is not the desktop window */
 
5654
            for (int i = Button4; i <= Button5; ++i)
 
5655
                XUngrabButton (screen->dpy (), i, Mod2Mask, frame);
5643
5656
        }
5644
5657
    }
5645
5658
}
5832
5845
        xwc.y = serverGeometry ().y () + wy;
5833
5846
 
5834
5847
        configureXWindow (valueMask, &xwc);
 
5848
 
 
5849
        if ((state () & CompWindowStateMaximizedHorzMask || state () & CompWindowStateMaximizedVertMask) &&
 
5850
            (defaultViewport () == screen->vp ()))
 
5851
            priv->initialViewport = screen->vp ();
5835
5852
    }
5836
5853
}
5837
5854
 
6664
6681
 
6665
6682
                if (xwc.x < workarea.x ())
6666
6683
                    xwc.x = workarea.x () + movement.x ();
 
6684
 
 
6685
                if (xwc.x - boffset.x () < workarea.x ())
 
6686
                    xwc.x += boffset.x ();
6667
6687
            }
6668
6688
 
6669
6689
            if (xwc.y + xwc.height > workarea.y2 ())
6672
6692
 
6673
6693
                if (xwc.y < workarea.y ())
6674
6694
                    xwc.y = workarea.y () + movement.y ();
 
6695
 
 
6696
                if (xwc.y - boffset.y () < workarea.y ())
 
6697
                    xwc.y += boffset.y ();
6675
6698
            }
6676
6699
 
6677
6700
            if (priv->actions & CompWindowActionResizeMask)