Registered Member
|
Here's what I'm trying to achieve:
1. If i'm working on the notebook's screen(LVDS 1366x768) -- Google Chrome should start maximized; 2. If I'm working on the external display (VGA 1920x1080) -- Google Chrome should have specified geometry (size and position); Does KWin allow something like this?
pilat, proud to be a member of KDE forums since 2008-Oct.
|
|
You'll require a script for this:
http://techbase.kde.org/Development/Tut ... /Scripting http://techbase.kde.org/Development/Tut ... ng/API_4.9 |
Registered Member
|
Scripting is going to work. But I can't get through the documentation..
In particular, how to make client maximized.
pilat, proud to be a member of KDE forums since 2008-Oct.
|
KDE Developer
|
workspace.slotWindowMaximize() - but it looks like only active client can get maximized that way. The property on Client is either not supported or the documentation is outdated. |
|
Nope, maximizeMode is not exported
For the moment, you'll have to
|
Registered Member
|
Thank you! What about restoring to normal (from maximized)?
It looks that applying custom geomtry does not work if the window is started maximized... Here's my curent code:
Seems to only work if the window is started non-maximized.
pilat, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
Does not work.. The window is activated, but not maximized. I've even tried the following "direct" (without signals) code in the wm console:
It activates the window I need to maximize (brings it to forward, puts focus into it), but it is "WM Console" window itself that gets maximized.. Tried with Google Chrome an Okular. With pause between those two lines and without.
pilat, proud to be a member of KDE forums since 2008-Oct.
|
|
a bit more tricky since the client is not actually mapped when the added signal fires.
this should work:
|
Registered Member
|
Thank you for this example. I'd like to confirm one thing: There's a block:
Why it is expected to be executed in "Small area" case only? Shouldn't it be before `if (area.width < 1025)` line?
pilat, proud to be a member of KDE forums since 2008-Oct.
|
|
changing the active client is only required to maximize it.
you don't want it maximized on the big screen, right? |
Registered Member
|
Thank you. Here's my version of the script:
https://github.com/mityukov/kwinscripts ... de/main.js There is strange behavior, however: first time a new Google Chrome window is opened maximized. If I closeit and then re-open -- it becomes of expected size.
pilat, proud to be a member of KDE forums since 2008-Oct.
|
|
Yupp see this (when creating new windows with the chromium shortcut at least)
-> can you please bump this thread next week (so i won't forget it |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar