~ubuntu-branches/ubuntu/trusty/xfwm4/trusty

« back to all changes in this revision

Viewing changes to src/client.c

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2011-09-23 20:25:39 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: package-import@ubuntu.com-20110923202539-4tf7neso3zb7zb5d
Tags: 4.8.2-0ubuntu1
Upload pkg-xfce trunk (r6052) to oneiric.

Show diffs side-by-side

added added

removed removed

Lines of Context:
666
666
    }
667
667
    if (mask & CWWidth)
668
668
    {
669
 
        clientSetWidth (c, wc->width);
 
669
        c->width = wc->width;
670
670
    }
671
671
    if (mask & CWHeight)
672
672
    {
673
 
        clientSetHeight (c, wc->height);
 
673
        c->height = wc->height;
674
674
    }
675
675
    if (mask & CWBorderWidth)
676
676
    {
853
853
        }
854
854
        flags |= CFG_REQUEST;
855
855
    }
856
 
    if (mask & (CWWidth | CWHeight))
 
856
    if ((mask & (CWWidth | CWHeight)) && !(mask & (CWX | CWY)))
857
857
    {
858
 
        flags |= CFG_KEEP_VISIBLE;
 
858
        /*
 
859
         * The client is resizing its window, but did not specify a
 
860
         * position, make sure the window remains fully visible in that
 
861
         * case so that the user does not have to relocate the window
 
862
         */
 
863
        flags |= CFG_CONSTRAINED | CFG_KEEP_VISIBLE;
859
864
    }
860
865
    /*
861
 
       Let's say that if the client performs a XRaiseWindow, we show the window if focus
862
 
       stealing prevention is not activated, otherwise we just set the "demands attention"
863
 
       flag...
 
866
     * Let's say that if the client performs a XRaiseWindow, we show the window if focus
 
867
     * stealing prevention is not activated, otherwise we just set the "demands attention"
 
868
     * flag...
864
869
     */
865
870
    if ((mask & CWStackMode) && (wc->stack_mode == Above) && (wc->sibling == None) && !(c->type & WINDOW_TYPE_DONT_FOCUS))
866
871
    {
2602
2607
        }
2603
2608
        clientRaise (sibling, None);
2604
2609
        clientShow (sibling, TRUE);
2605
 
        if (source_is_application || screen_info->params->click_to_focus)
 
2610
        if (source_is_application || screen_info->params->click_to_focus || (c->type & WINDOW_TYPE_DONT_FOCUS))
2606
2611
        {
 
2612
            /*
 
2613
               It's a bit tricky here, we want to honor the activate request only if:
 
2614
 
 
2615
               - The window use the _NET_ACTIVE_WINDOW protocol and identify itself as an application,
 
2616
               - Or we use the click to focus model, in that case we focus the raised window anyway,
 
2617
               - Or the request comes from an application that we would not focus by default,
 
2618
                 such as panels for example
 
2619
             */
2607
2620
            clientSetFocus (screen_info, c, timestamp, NO_FOCUS_FLAG);
2608
2621
        }
2609
2622
        clientSetLastRaise (c);