mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-01 09:18:07 +00:00
don't resize the window on keyboard
This commit is contained in:
parent
e2219e8402
commit
7a3c32949a
2 changed files with 10 additions and 30 deletions
|
|
@ -138,13 +138,9 @@ Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: 5
|
z: 5
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (!visible) {
|
if (!visible && compositorRoot.shellWindow) {
|
||||||
compositorRoot.shellWindow.child.takeFocus();
|
compositorRoot.shellWindow.child.takeFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compositorRoot.currentWindow) {
|
|
||||||
compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - (visible ? 500 : 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -328,6 +324,9 @@ Rectangle {
|
||||||
} else {
|
} else {
|
||||||
desktopLayer.z = 1;
|
desktopLayer.z = 1;
|
||||||
windowsLayerBackground.z = 2;
|
windowsLayerBackground.z = 2;
|
||||||
|
if (compositorRoot.currentWindow) {
|
||||||
|
compositorRoot.currentWindow.child.takeFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -173,16 +173,12 @@ function mapShellSurface(surface, child) {
|
||||||
|
|
||||||
if (entry.surface === surface) {
|
if (entry.surface === surface) {
|
||||||
// Switch to layer and take focus
|
// Switch to layer and take focus
|
||||||
if (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") {
|
if (surface.className == "plasmashell.desktop") {
|
||||||
compositorRoot.showPanel = true;
|
compositorRoot.showPanel = true;
|
||||||
} else {
|
} else {
|
||||||
compositorRoot.state = "homeScreen";
|
compositorRoot.state = "homeScreen";
|
||||||
}
|
}
|
||||||
if (surface.className == "maliit-server.desktop") {
|
|
||||||
compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - 500;
|
|
||||||
} else {
|
|
||||||
entry.window.child.takeFocus();
|
entry.window.child.takeFocus();
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -198,27 +194,22 @@ function mapShellSurface(surface, child) {
|
||||||
// Create and setup window container
|
// Create and setup window container
|
||||||
// XXX: We only support desktop roles for now
|
// XXX: We only support desktop roles for now
|
||||||
var window = component.createObject(compositorRoot, {"child": child});
|
var window = component.createObject(compositorRoot, {"child": child});
|
||||||
window.parent = (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") ? compositorRoot.layers.panel : compositorRoot.layers.desktop;
|
window.parent = (surface.className == "plasmashell.desktop") ? compositorRoot.layers.panel : compositorRoot.layers.desktop;
|
||||||
window.child.parent = window;
|
window.child.parent = window;
|
||||||
window.child.touchEventsEnabled = true;
|
window.child.touchEventsEnabled = true;
|
||||||
window.x = window.y = 0;
|
window.x = window.y = 0;
|
||||||
window.width = surface.size.width;
|
window.width = surface.size.width;
|
||||||
window.height = surface.size.height;
|
window.height = surface.size.height;
|
||||||
if (surface.className == "maliit-server.desktop") {
|
|
||||||
window.y = compositorRoot.layers.panel.height - window.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Switch to the desktop layer and take focus
|
// Switch to the desktop layer and take focus
|
||||||
compositorRoot.showSplash = false;
|
compositorRoot.showSplash = false;
|
||||||
if (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") {
|
if (surface.className == "plasmashell.desktop") {
|
||||||
compositorRoot.showPanel = true;
|
compositorRoot.showPanel = true;
|
||||||
} else {
|
} else {
|
||||||
compositorRoot.state = "homeScreen";
|
compositorRoot.state = "homeScreen";
|
||||||
compositorRoot.shellWindow = window;
|
compositorRoot.shellWindow = window;
|
||||||
}
|
}
|
||||||
if (surface.className != "maliit-server.desktop") {
|
|
||||||
window.child.takeFocus();
|
window.child.takeFocus();
|
||||||
}
|
|
||||||
|
|
||||||
// Add surface to the model
|
// Add surface to the model
|
||||||
surfaceModel.append({"surface": surface, "window": window});
|
surfaceModel.append({"surface": surface, "window": window});
|
||||||
|
|
@ -231,9 +222,6 @@ function mapKeyboardSurface(surface) {
|
||||||
var entry = surfaceModel.get(i);
|
var entry = surfaceModel.get(i);
|
||||||
|
|
||||||
if (entry.surface === surface) {
|
if (entry.surface === surface) {
|
||||||
if (compositorRoot.currentWindow) {
|
|
||||||
compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - 500;
|
|
||||||
}
|
|
||||||
compositorRoot.showKeyboard = true;
|
compositorRoot.showKeyboard = true;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -260,10 +248,6 @@ function mapKeyboardSurface(surface) {
|
||||||
window.height = surface.size.height;
|
window.height = surface.size.height;
|
||||||
window.y = compositorRoot.layers.keyboard.height - window.height;
|
window.y = compositorRoot.layers.keyboard.height - window.height;
|
||||||
|
|
||||||
if (compositorRoot.currentWindow) {
|
|
||||||
compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height - 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add surface to the model
|
// Add surface to the model
|
||||||
surfaceModel.append({"surface": surface, "window": window});
|
surfaceModel.append({"surface": surface, "window": window});
|
||||||
compositorRoot.showKeyboard = true;
|
compositorRoot.showKeyboard = true;
|
||||||
|
|
@ -281,11 +265,8 @@ function unmapApplicationSurface(surface) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unmapShellSurface(surface) {
|
function unmapShellSurface(surface) {
|
||||||
if (surface.className == "maliit-server.desktop") {
|
|
||||||
compositorRoot.currentWindow.child.height = compositorRoot.layers.windows.height;
|
|
||||||
}
|
|
||||||
// Hide panel layer if this is the sliding panel
|
// Hide panel layer if this is the sliding panel
|
||||||
if (surface.className == "plasmashell.desktop" || surface.className == "maliit-server.desktop") {
|
if (surface.className == "plasmashell.desktop") {
|
||||||
compositorRoot.showPanel = false;
|
compositorRoot.showPanel = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue