Bug 237304 - Input fields in Plasma Panels are unable to receive focus when other windows are open
Summary: Input fields in Plasma Panels are unable to receive focus when other windows ...
Status: RESOLVED DUPLICATE of bug 177674
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:
Depends on:
Blocks:
 
Reported: 2010-05-11 23:02 UTC by Shantanu Tushar
Modified: 2010-05-13 23:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shantanu Tushar 2010-05-11 23:02:35 UTC
Version:           4.4.74 (using Devel)
Compiler:          gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 
OS:                Linux
Installed from:    Compiled sources

Input fields in Plasma Panels are unable to receive focus when other windows are open. I'm not sure whether its a KWin bug or not, but I guess that might be it.

Steps to reproduce-
1. Add a applet which takes input (e.g Notes, Microblog) to a panel (a new one maybe added to test).
2. Open some application windows, try to position the cursor in the applet's input fields.
3. It doesn't take any input or display the cursor, possibly because the focus isn't provided to the applet.

The following is a use case for fixing this behaviour-
"I have microblog in a panel and when I've Firefox open, I want to tweet something, have to minimize everything. Its cumbersome."

Expected-
The applets inside panels should be able to receive input even if application windows are open.
Comment 1 Thomas Lübking 2010-05-11 23:35:57 UTC
kwin* doesn't focus docks, this would probably cause issues with systray icons and the taskbar (at least flicker), therefore i doubt this will change.

so if sth. (the applet) in a dock requires kbd input focus it will have to take it (on mouseclicks) itself.

*neither do openbox or e17 - compiz is the only WM i know that passes the focus to dock type windows and returns it to the former window on mouse leave events
Comment 2 Shantanu Tushar 2010-05-13 16:09:16 UTC
Well I tried doing a setFocus() on the textEdit (if that is what you meant) on mouse clicks. I am sure that the method is getting called, but it still doesn't focus the textBox. Any suggestions?
Comment 3 Thomas Lübking 2010-05-13 16:27:50 UTC
no, i'm sorry for the ambiguity.

"WM Focus" -> QWidget::activateWindow();
Comment 4 Shantanu Tushar 2010-05-13 20:40:05 UTC
Thanks for the help, but I think I'm missing something. I tried m_statusEdit->nativeWidget()->activateWindow(); inside a eventFilter attached to m_statusEdit. Doesn't seem to work, but the event filter is being called (kDebug verification). Any pointers?
Comment 5 Marco Martin 2010-05-13 21:19:55 UTC

*** This bug has been marked as a duplicate of bug 177674 ***
Comment 6 Thomas Lübking 2010-05-13 22:17:30 UTC
no idea. clearly works for me with *native qwidget* usage (i've never tried that with a graphicswidget, does it return a valid "m_statusEdit->nativeWidget()->window();"?)

MyDock::MyDock(.)
{
    KWindowSystem::setType( winId(), NET::Dock );
    // ....
}

bool MyDock::eventFilter( QObject *o, QEvent *ev )
{   // hangs on few special child widgets
    if ( ev->type() == QEvent::MouseButtonPress )
        activateWindow();
    // ....
}

weird guess would be to call:
if (m_statusEdit->nativeWidget()->window())
   m_statusEdit->nativeWidget()->window()->activateWindow();
else
   qDebug("there is no spoon... err \"window\"");
Comment 7 Marco Martin 2010-05-13 23:00:52 UTC
@Thomas Lübking:
kwin can still deny focus to a widget that wants to be activated:
what we want in this case is KWindowSystem::forceActiveWindow()
Comment 8 Thomas Lübking 2010-05-13 23:32:58 UTC
(In reply to comment #7)
> kwin can still deny focus to a widget that wants to be activated:
sure, eg. if you set a high focus protection level.
has been identified why plasma panels get a "mean" handling (compared to my random dock window - the relevant properties are equal)?
Tried on "medium" focus stealing protection.

maybe this is important:
my dock also gets a "raise();" request before.

> what we want in this case is KWindowSystem::forceActiveWindow()
"The usage of forceActiveWindow() is meant only for pagers and similar tools, which represent direct user actions related to window manipulation.
Except for rare cases, this request will be always honored, and normal applications are forbidden to use it."