<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>128648</bug_id>
          
          <creation_ts>2006-06-05 03:10:58 +0000</creation_ts>
          <short_desc>Click raise active window doesn&apos;t raise the active window</short_desc>
          <delta_ts>2008-03-14 18:11:03 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>compositing</component>
          <version>unspecified</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Joseph Smith">alienfeet2000</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>kde</cc>
    
    <cc>ovit.debian</cc>
    
    <cc>sgrayban</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>444383</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Smith">alienfeet2000</who>
    <bug_when>2006-06-05 03:11:00 +0000</bug_when>
    <thetext>Version:           3.5.3 (using KDE KDE 3.5.3)
Installed from:    Gentoo Packages
Compiler:          gcc 4.1.1  gcc (GCC) 4.1.1 (Gentoo 4.1.1)
OS:                Linux

The click raise active window setting no longer raises the active window.  I noticed this after updating from KDE 3.5.2.  I&apos;m using the focus follows mouse focus policy with a focus delay of 500ms.  Click to raise works if you click in an unfocused window (before the 500ms delay expires), which is the behavior I expect, but as soon as a lower window attains focus &apos;click raise active window&apos; doesn&apos;t work.

To reproduce:
1) Set focus follows mouse focus policy.
2) Set delay focus for 500ms.
3) Select focus follows mouse.
4) Put two windows on the desktop.
5) Focus on the lower window area by letting the delay focus expire.
6) Click on the focused window area (not the titlebar) and notice that it doesn&apos;t raise.

The expected behavior is that the lower focused window should raise when clicking in the window area.

Currently, the only way to raise a window when clicking in the window area is to click in the window when unfocused.  This is the expected behavior for unfocused windows, and it was the behavior with 3.5.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444672</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Smith">alienfeet2000</who>
    <bug_when>2006-06-07 09:27:19 +0000</bug_when>
    <thetext>It looks like this may be related to the Xorg server version and not the KDE version, but it still may be a bug in kwin.  My system upgraded the Xorg server while KDE was updated to 3.5.3.  I don&apos;t have KDE 3.5.2 installed anymore, so I can&apos;t say if the newer Xorg modules will produce the same problem with that version of kwin.  In any case, there appears to be an incompatibility between KDE 3.5.3 and Xorg 7.1.  I&apos;ve listed Xorg modules that were updated with KDE.


The problem is not apparent with the following Xorg modules:
xorg-server-1.0.2
xf86-input-mouse-1.0.4
xf86-input-keyboard-1.0.1.3
xf86-video-ati-6.5.8.0
xorg-x11-7.0


The upgraded versions are:
xorg-server-1.1.0
xf86-video-vesa-1.2.0
xf86-video-ati-6.6.0
xf86-input-mouse-1.1.1
xf86-input-keyboard-1.1.0
xorg-x11-7.1

These are Gentoo module versions, but I think they correspond to the Xorg module versions.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>445055</commentid>
    <comment_count>2</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2006-06-08 14:10:15 +0000</bug_when>
    <thetext>Works fine with KDE 3.5.3 and XOrg 6.9.0. I&apos;m afraid it&apos;ll take some time before I&apos;ll have some system with 7.1 handy.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>463526</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Smith">alienfeet2000</who>
    <bug_when>2006-08-26 19:20:25 +0000</bug_when>
    <thetext>It appears that this problem may be more directly related to using kompmgr.  The problem seems to only appear with Xorg 7.1 when kompmgr is running.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>477763</commentid>
    <comment_count>4</comment_count>
    <who name="Andy Neitzke">neitzke</who>
    <bug_when>2006-10-18 01:32:14 +0000</bug_when>
    <thetext>I have this problem too under xorg 7.1 -- and indeed only when kompmgr is running.  I am using KDE 3.5.5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>480202</commentid>
    <comment_count>5</comment_count>
    <who name="Kyle">kleber</who>
    <bug_when>2006-10-27 21:57:55 +0000</bug_when>
    <thetext>I have seen this problem on Kubuntu (dapper) with X.org 7.0.0.  I find it to be unrelated to any &apos;delay focus&apos; setting.  </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>480203</commentid>
    <comment_count>6</comment_count>
    <who name="Kyle">kleber</who>
    <bug_when>2006-10-27 21:59:36 +0000</bug_when>
    <thetext>I should have mentioned, I have KDE 3.5.2 installed as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>483505</commentid>
    <comment_count>7</comment_count>
    <who name="Kim Rasmussen">signup</who>
    <bug_when>2006-11-03 13:11:41 +0000</bug_when>
    <thetext>I have the same problem under XOrg 7.1.1, but only when running kompmgr. I am using KDE 3.5.5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485124</commentid>
    <comment_count>8</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2006-11-08 14:53:54 +0000</bug_when>
    <thetext>SVN commit 603293 by lunakl:

Ok, with a compositing manager running, VisibilityNotify no longer
considers windows not visible just because a window is above them,
so the code from r198017 no longer works.
BUG: 128648




 M  +0 -1      client.cpp  
 M  +0 -2      client.h  
 M  +3 -22     events.cpp  
 M  +4 -0      layers.cpp  
 M  +1 -2      manage.cpp  
 M  +1 -2      workspace.cpp  


--- branches/KDE/3.5/kdebase/kwin/client.cpp #603292:603293
@@ -128,7 +128,6 @@
     modal = false;
     noborder = false;
     user_noborder = false;
-    not_obscured = false;
     urgency = false;
     ignore_focus_stealing = false;
     demands_attention = false;
--- branches/KDE/3.5/kdebase/kwin/client.h #603292:603293
@@ -336,7 +336,6 @@
         void clientMessageEvent( XClientMessageEvent* e );
         void enterNotifyEvent( XCrossingEvent* e );
         void leaveNotifyEvent( XCrossingEvent* e );
-        void visibilityNotifyEvent( XVisibilityEvent* e );
         void focusInEvent( XFocusInEvent* e );
         void focusOutEvent( XFocusOutEvent* e );
 
@@ -485,7 +484,6 @@
         uint modal : 1; // NET::Modal
         uint noborder : 1;
         uint user_noborder : 1;
-        uint not_obscured : 1;
         uint urgency : 1; // XWMHints, UrgencyHint
         uint ignore_focus_stealing : 1; // don&apos;t apply focus stealing prevention to this client
         uint demands_attention : 1;
--- branches/KDE/3.5/kdebase/kwin/events.cpp #603292:603293
@@ -631,9 +631,6 @@
                 workspace()-&gt;updateColormap();
             }
             break;
-        case VisibilityNotify:
-            visibilityNotifyEvent( &amp;e-&gt;xvisibility );
-            break;
         default:
             if( e-&gt;xany.window == window())
             {
@@ -1009,18 +1006,13 @@
  */
 void Client::updateMouseGrab()
     {
-    if( workspace()-&gt;globalShortcutsDisabled())
-        {
-        XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, wrapperId());
-        // keep grab for the simple click without modifiers if needed
-        if( !( !options-&gt;clickRaise || not_obscured ))
-            grabButton( None );
-        return;
-        }
     if( isActive() &amp;&amp; !workspace()-&gt;forcedGlobalMouseGrab()) // see Workspace::establishTabBoxGrab()
         {
         // remove the grab for no modifiers only if the window
         // is unobscured or if the user doesn&apos;t want click raise
+        // (it is unobscured if it the topmost in the unconstrained stacking order, i.e. it is
+        // the most recently raised window)
+        bool not_obscured = workspace()-&gt;topClientOnDesktop( workspace()-&gt;currentDesktop(), true ) == this;
         if( !options-&gt;clickRaise || not_obscured )
             ungrabButton( None );
         else
@@ -1455,17 +1447,6 @@
         setActive( FALSE );
     }
 
-void Client::visibilityNotifyEvent( XVisibilityEvent * e)
-    {
-    if( e-&gt;window != frameId())
-        return; // care only about the whole frame
-    bool new_not_obscured = e-&gt;state == VisibilityUnobscured;
-    if( not_obscured == new_not_obscured )
-        return;
-    not_obscured = new_not_obscured;
-    updateMouseGrab();
-    }
-
 // performs _NET_WM_MOVERESIZE
 void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction )
     {
--- branches/KDE/3.5/kdebase/kwin/layers.cpp #603292:603293
@@ -117,7 +117,11 @@
         }
 #endif
     if( changed || propagate_new_clients )
+        {
         propagateClients( propagate_new_clients );
+        if( active_client )
+            active_client-&gt;updateMouseGrab();
+        }
     }
 
 /*!
--- branches/KDE/3.5/kdebase/kwin/manage.cpp #603292:603293
@@ -565,8 +565,7 @@
             FocusChangeMask |
             ExposureMask |
             PropertyChangeMask |
-            StructureNotifyMask | SubstructureRedirectMask |
-            VisibilityChangeMask );
+            StructureNotifyMask | SubstructureRedirectMask );
     XSelectInput( qt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask );
     XSelectInput( qt_xdisplay(), client,
                   FocusChangeMask |
--- branches/KDE/3.5/kdebase/kwin/workspace.cpp #603292:603293
@@ -2022,8 +2022,7 @@
     XSetWindowAttributes attributes;
     unsigned long valuemask;
     attributes.override_redirect = True;
-    attributes.event_mask =  (EnterWindowMask | LeaveWindowMask |
-                              VisibilityChangeMask);
+    attributes.event_mask =  ( EnterWindowMask | LeaveWindowMask );
     valuemask=  (CWOverrideRedirect | CWEventMask | CWCursor );
     attributes.cursor = XCreateFontCursor(qt_xdisplay(),
                                           XC_sb_up_arrow);
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494649</commentid>
    <comment_count>9</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2006-12-18 13:54:47 +0000</bug_when>
    <thetext>*** Bug 138875 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>528082</commentid>
    <comment_count>10</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2007-05-25 16:17:11 +0000</bug_when>
    <thetext>*** Bug 145902 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586945</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Grayban">sgrayban</who>
    <bug_when>2008-03-14 18:11:03 +0000</bug_when>
    <thetext>This patch has also broken Superkaramba -- have months of testing and working out what was changed we found that this fix has broken superkaramba.

See bug #143255</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>