~ubuntu-branches/ubuntu/trusty/gtk2-engines-oxygen/trusty-proposed

« back to all changes in this revision

Viewing changes to src/oxygenwindowmanager.cpp

  • Committer: Package Import Robot
  • Author(s): Scarlett Clark
  • Date: 2014-02-12 06:35:44 UTC
  • mfrom: (1.3.2)
  • Revision ID: package-import@ubuntu.com-20140212063544-nnetktl56v0huubt
Tags: 1.4.3-0ubuntu1
* New upstream release
* One major issue was fixed (basically some dangling
  pointers being wrongly accessed). (LP: #1219844)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
* -------------------
5
5
*
6
6
* Copyright (c) 2010 Cédric Bellegarde <gnumdk@gmail.com>
7
 
* Copyright (c) 2010 Hugo Pereira Da Costa <hugo@oxygen-icons.org>
 
7
* Copyright (c) 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
8
8
*
9
9
* Largely inspired from Qtcurve style
10
10
* Copyright (C) Craig Drummond, 2003 - 2010 craig.p.drummond@gmail.com
508
508
    {
509
509
 
510
510
        if( _dragMode == Disabled ) return false;
511
 
        else if( !_dragAboutToStart && withinWidget(widget, event ) && useEvent( widget, event ) )
 
511
        else if( !_dragAboutToStart && checkCursor( event->window ) && withinWidget(widget, event ) && useEvent( widget, event ) )
512
512
        {
513
513
 
514
514
            // store widget and event position
537
537
    }
538
538
 
539
539
    //_________________________________________________
 
540
    bool WindowManager::checkCursor( GdkWindow* window ) const
 
541
    {
 
542
        if( !window ) return true;
 
543
        GdkCursor* cursor = gdk_window_get_cursor( window );
 
544
 
 
545
        // do not propagate if widget's cursor is currently modified,
 
546
        // since it is usually indicative of mouse action
 
547
        return !cursor || gdk_cursor_get_cursor_type( cursor ) == GDK_ARROW;
 
548
 
 
549
    }
 
550
 
 
551
    //_________________________________________________
540
552
    bool WindowManager::withinWidget( GtkWidget* widget, GdkEventButton* event ) const
541
553
    {
542
554
 
664
676
            if( !( event && withinWidget( childWidget, event ) ) )
665
677
            { continue; }
666
678
 
667
 
            // do not propagate if widget's cursor is currently modified,
668
 
            // since it is usually indicative of mouse action
669
 
            GdkCursor* cursor = gdk_window_get_cursor( window );
670
 
            if( cursor && gdk_cursor_get_cursor_type( cursor ) != GDK_ARROW )
671
 
            { usable = false; }
672
 
 
673
679
            // check special cases for which grab should not be enabled
674
680
            if( usable && (
675
681
                widgetIsBlackListed( childWidget ) ||