Bug 69519 - dialogs not activated because of focus stealing prevention
Summary: dialogs not activated because of focus stealing prevention
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 69931 70327 71409 71526 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-02 19:48 UTC by Anders Lund
Modified: 2004-06-03 17:17 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Lund 2003-12-02 19:48:07 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.2.2 
OS:          Linux

Very often, dialogs that need immediate attention are not raised.
Examples:
When kopete starts, the kwallet password dialog is not raised.
When dragging text to the desktop, the "filename for clipboard content" dialog is not raised

The taskbar button is blinking in selection color, but having the taskbar in a separate, autohidden panel makes even that notification useless, and it is still not good enough. Those dialogs should be globally modal, and brought to the very top immediately.
Comment 1 Lubos Lunak 2003-12-09 15:29:29 UTC
NOTE TO SELF: Check also all cases described in duplicates before closing.
Comment 2 Lubos Lunak 2003-12-09 15:55:08 UTC
*** Bug 69931 has been marked as a duplicate of this bug. ***
Comment 3 Lubos Lunak 2003-12-15 15:11:34 UTC
*** Bug 70327 has been marked as a duplicate of this bug. ***
Comment 4 Lubos Lunak 2004-01-05 15:00:52 UTC
*** Bug 71526 has been marked as a duplicate of this bug. ***
Comment 5 Lubos Lunak 2004-01-07 13:21:00 UTC
*** Bug 71409 has been marked as a duplicate of this bug. ***
Comment 6 Lubos Lunak 2004-01-08 14:37:44 UTC
kget, kwallet, kio_uiserver already worked around for 3.2.
Comment 7 Lubos Lunak 2004-01-08 19:19:01 UTC
For dragging text to desktop, Qt patch sent to TT, that one will be only in Qt-3.3 I'm afraid.
All the problems listed in this bugreport and the duplicates should be handled now. If there are some more problems, please list them here.
Comment 8 bj 2004-01-11 04:29:57 UTC
Looks like the same problem is happening for KGpg:
Open file manager, right click on a file, choose "encrypt file", and the key selection dialog appears underneath the kfm window...
Comment 9 Dik Takken 2004-01-11 10:43:41 UTC
And in Quanta. You open a remote project file on a server via SSH. The authentication dialog pops up behind the "opening project" progress dialog.
Comment 10 Martin Koller 2004-01-11 11:39:16 UTC
In korganizer, if you want to publish an appointment via email to someone, the mail composer window stays hidden behind korganizer.
Comment 11 Lubos Lunak 2004-01-13 13:10:22 UTC
I cannot reproduce the kgpg problem, it seems to work fine.
Please be more detailed about the Quanta problem, I have no idea what you're talking about (I've never really used Quanta).
I also don't see any problem with KOrganizer, please describe how to reproduce it.

Comment 12 Maik Schulz 2004-01-13 15:00:58 UTC
Here is how to reproduce it with a dialog from KWallet:
- My Kopete uses KWallet to store it's passwords
- I open Kontact (KMail), it fills most of my window space
- I log into an account from Kopete (first time, KWallet is still closed)
- The password dialog from KWallet opens, but is hidden beneath the Kontact window
Comment 13 Dik Takken 2004-01-13 15:09:32 UTC
> Please be more detailed about the Quanta problem

How to reproduce:

* Create a project which is stored on a remote SSH server and thus requires login. This is a bit tricky using Quanta 3.2.94, it doesn't work perfectly yet.
* Make sure the password to the server is not stored. 
* Now every time you hit 'save' (and the connection has timed out), or load your remote project in Quanta, it will ask for your password. This dialog frequently pops up behind the 'saving file' or 'opening project..' dialog.
Comment 14 bj 2004-01-14 00:57:29 UTC
Subject: Re:  dialogs not activated because of focus stealing prevention

I just recompiled a fresh cvs. The problem still occurs with KGpg.
To reproduce:

- Open Key Manager (left click on KGpg applet)
- Close Key Manager (left click on KGpg applet again)
- Open Konqueror in a local directory, left click on a file -> encrypt file

The key selection dialogappears underneath Konqueror.
Looks like the bug only occurs if another KGpg window was previously opened...

You can also reproduce the bug by trying to directly encrypt a file from 
Konqueror, when prompted with the key selection dialog, click cancel. Try 
again, the key selection dialog will now appear under the Konqueror window

Regards
Comment 15 Lubos Lunak 2004-01-15 17:08:24 UTC
KGpg fixed. KWallet has been already worked around.
Comment 16 Martin Koller 2004-01-15 22:09:12 UTC
Subject: Re:  dialogs not activated because of focus stealing prevention

On Tuesday 13 January 2004 13:10, Lubos Lunak wrote:
> I also don't see any
> problem with KOrganizer, please describe how to reproduce it.

Did now a new install from CVS from today to be sure.

Make sure you have the setting for group scheduling "send directly" and the 
setting personal/mail client/kmail.

(I have kmail already running on another desktop when doing all this)

Create an event, then select it by clicking on in (e.g. in the view for one 
day), then click on the icon "Publish" (or menu schedule->publish). 

The kmail editor will be opened but in the background (behind the full screen 
korganizer window)

Comment 17 bj 2004-01-19 01:01:48 UTC
Subject: Re:  dialogs not activated because of focus stealing prevention

Thanks for the KGpg bugfix... but I just discovered another case... sorry.
It is not KGpg related, but related to konqueror.

To reproduce:
- Open a konqueror window in a local directory
- Open KGpg key management window.
- Drag a key from KGpg to konqueror (it does export the public key)

The dialog asking for a file name appears beneath the konqueror window.
(Basically, the bug occurs when you try to drag text into a konqueror local 
view)

Regards

Comment 18 Lubos Lunak 2004-01-19 13:40:51 UTC
#17: That's drag&drop, the same like comment #7, fix in Qt-3.3.
Comment 19 Dik Takken 2004-01-23 11:05:52 UTC
Lubos: I'm running RC1 now, and the problem with Quanta authentication dialogs seems to be gone.
Comment 20 Dik Takken 2004-01-29 12:58:12 UTC
with Kopete in 3.2 RC1, when the connection is lost, the error message dialog appears behind all other apps on the desktop. As a result, the Kopete window itself appears to stop responding.
Comment 21 bj 2004-01-31 20:02:16 UTC
Subject: Re:  dialogs not activated because of focus stealing prevention

A new bug was just reported with KGPG... AArgh I guess it's too late for KDE 
3.2...

Open a konqueror window in your local drive, left click on an encrypted file, 
the password dialog pops up behind the konqueror window!!!

It makes decrypting from konqueror really painfull.

regards
Comment 22 Lubos Lunak 2004-02-05 19:18:22 UTC
The Kopete problem should be fixed now I believe.
Comment 23 Bjorn Dittmer-Roche 2004-02-28 17:05:19 UTC
I had a simmilar problem with java (not sure if this is the place to report it, but it seems to be the same bug and looks like it would be useful for y'all to know about.) I've tried Sun's java bug reporting and FreeBSD's bug reporting and they both say "sorry, not my problem." Here's the java code that doesn't work in KDE but works in other window managers (I am using KDE 3.2.0, FreeBSD 4.9 (Stable), jsdk1.4):

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;

public final class BuggyWindow2 extends JWindow implements Runnable
{
   JTextField jtf;
   JTextArea jta;

   public static void main( String args[] )
   {
      BuggyWindow2 bw2;
      (bw2 = new BuggyWindow2()).show();
      try { Thread.sleep(1000); } catch (InterruptedException ie) {}
      SwingUtilities.invokeLater( bw2 );
   }
   public BuggyWindow2()
   {
      //setUndecorated( true );
      getContentPane().add( new JLabel( "Hello" ) );
      pack();
   }
   public void run()
   {
      JOptionPane.showMessageDialog( this, "This should be on top",
            "This should be on top", JOptionPane.PLAIN_MESSAGE );
   }
}


Comment 24 Lubos Lunak 2004-05-26 11:25:18 UTC
kgpg problem should be fixed properly in CVS HEAD.
Comment 25 Lubos Lunak 2004-05-26 12:34:45 UTC
#23: The first window is initially mapped with input in WM_HINT set to false, meaning the window doesn't want focus, and only later the hint is changed to true -> the window is not focused after being shown -> it doesn't become the active window -> the second window belongs to non-active application, and as such its activation is prevented.
The handling of nofocus windows should be improved, but the main problem with the java code is the java(?) bug with the focus hint - after removing the second window and leaving only the first "Hello" window, that window is not initially focused even with other window managers.
Comment 26 Lubos Lunak 2004-06-03 17:17:47 UTC
kgpg problem fixed again in CVS HEAD, this time properly.
korganizer problem fixed in CVS HEAD.
That should be the last pending problems, so I'm closing this bugreport as fixed. If there are still any problems to be fixed, please complain.