Bug 328035 - yakuake doesn't attach to the top of the screen on second screen
Summary: yakuake doesn't attach to the top of the screen on second screen
Status: RESOLVED FIXED
Alias: None
Product: yakuake
Classification: Applications
Component: general (show other bugs)
Version: Git (KDE Platform 4)
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Eike Hein
URL: http://i.imgur.com/NbvYKro.jpg
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-24 22:07 UTC by Kamil Kuduk
Modified: 2014-06-14 16:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch fixing the problem (584 bytes, patch)
2013-11-24 22:25 UTC, Kamil Kuduk
Details
Hopefully correct patch (622 bytes, patch)
2013-11-26 17:10 UTC, Eike Hein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kamil Kuduk 2013-11-24 22:07:20 UTC
With multi-monitor setup, when one screen has a panel on top, yakuake does not attach to the top of the screen on the second one.

Reproducible: Always

Steps to Reproduce:
1. Use dual screen setup 
2. Put a panel on the top of one screens 
3. Set: Open on screen: "at mouse location"
4. Move cursor to the panel-less screen and enable yakuake
Actual Results:  
Console is no attached to the top edge of the screen: there is a gap with the same width as the panel

Expected Results:  
Console is attached to the top edge of the screen 

I think the problem is in:
app/mainwindow.cpp:
1283                 KWindowInfo windowInfo = KWindowSystem::windowInfo(windowId, NET::WMDesktop, NET::WM2ExtendedStrut);
1284 
1285                 if (windowInfo.valid() && windowInfo.desktop() == currentDesktop)
1286                 {

it looks like windowInfo.desktop() returns -1 for panels (I'm totally new to KDE development, so I might be wrong - API Doc doesn't explain that). What I did is simply changed that to:
if (windowInfo.valid() && windowInfo.isOnCurrentDesktop() )
and it works as expected.
Comment 1 Kamil Kuduk 2013-11-24 22:25:52 UTC
Created attachment 83740 [details]
patch fixing the problem
Comment 2 Kamil Kuduk 2013-11-25 20:39:40 UTC
One more comment. 
from: kdeui / windowmanagement / kwindowinfo_x11.cpp
int KWindowInfo::desktop() const
{
[...]
    if( KWindowSystem::mapViewport()) {
        if( onAllDesktops())
            return NET::OnAllDesktops;
        return KWindowSystem::viewportWindowToDesktop( d->geometry_ );
    }
    return d->info->desktop();
}

so KWindowInfo::desktop() returns -1 (NET::OnAllDesktops) if window is on all desktops. I'm not sure why this did work in the past though.
Comment 3 Eike Hein 2013-11-26 17:10:00 UTC
Created attachment 83775 [details]
Hopefully correct patch

Could you please check if the attached patch works for you as well?

(Your solution isn't quite right - the idea is to build a list of windows that KWindowSystem::workArea() should be ignoring.)
Comment 4 Eike Hein 2013-11-26 17:11:19 UTC
Oh, nvm, sorry - I just got back from a vacation and looked at the wrong patch. What yours is doing is equivalent to mine, just a little nicer. I'll apply it, thanks!
Comment 5 Eike Hein 2013-11-26 17:13:55 UTC
Git commit 785bac2127a46fae1ebf75b6f5ff2fb70015c796 by Eike Hein.
Committed on 26/11/2013 at 17:12.
Pushed by hein into branch 'master'.

Correctly catch offscreen panels when building the exclude list for workArea().

M  +1    -1    app/mainwindow.cpp

http://commits.kde.org/yakuake/785bac2127a46fae1ebf75b6f5ff2fb70015c796