From 2e9329d0be01860400598f8775079727b3df98c7 Mon Sep 17 00:00:00 2001 From: jeon Date: Fri, 28 Aug 2020 18:52:09 +0900 Subject: [PATCH] DSTextInput: set TextInput window to InputPanel's parent Change-Id: I1e16c37d74e6116b416c9c4afee3395f64b6ee09 --- src/DSWaylandServer/DSWaylandInputPanel.cpp | 38 +++++++---------------------- src/DSWaylandServer/DSWaylandTextInput.cpp | 13 +++++----- 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/DSWaylandServer/DSWaylandInputPanel.cpp b/src/DSWaylandServer/DSWaylandInputPanel.cpp index 77c65a0..f8b7d18 100644 --- a/src/DSWaylandServer/DSWaylandInputPanel.cpp +++ b/src/DSWaylandServer/DSWaylandInputPanel.cpp @@ -373,34 +373,14 @@ void DSWaylandInputPanelSurfacePrivate::setTransientForSurface(DSWaylandSurface { for (auto it = __dataMap.begin(); it != __dataMap.end(); it++) { - //DSWaylandInputPanelSurfaceData *surfaceData = (*it).second; - /* TODO: - * child = surfaceData->getWlSurface(); - * if child->parent - * { - * if child->parent != parent - * { - * remove child in child->parent->transients list - * child->parent = nullptr - * } - * } - * if parent != child && parent != child->parent - * { - * add child in child->parent->transients list - * child->parent = parent; - * } - * if (parent) - * { - * child->icccm.fetch.transientFor = true; - * child->icccm.transientFor = parent->id; - * } - * else - * { - * child->icccm.fetch.transientFor = false; - * child->icccm.transientFor = 0; - * } - * mark window changedr - */ + DSWaylandInputPanelSurfaceData *surfaceData = (*it).second; + DSWaylandSurface *child = surfaceData->getWlSurface(); + + // TODO: if current child has parent reset this + + DSWindowManager *windowManager = DSWindowManager::getInstance(); + windowManager->setWindowParent(child, parent); + windowManager->releaseInstance(); } } @@ -587,7 +567,7 @@ void DSWaylandInputPanelSurfacePrivate::__appendSurface(Resource *resource, void if (textInputSurface) { - //TODO: transparent set + pub->__inputPanel->setTransientFor(textInputSurface); } if (pub->__inputPanel->getRerunPanelShow()) diff --git a/src/DSWaylandServer/DSWaylandTextInput.cpp b/src/DSWaylandServer/DSWaylandTextInput.cpp index 743d57c..820e8ba 100644 --- a/src/DSWaylandServer/DSWaylandTextInput.cpp +++ b/src/DSWaylandServer/DSWaylandTextInput.cpp @@ -271,15 +271,16 @@ void DSWaylandTextInputPrivate::showInputPanel(void *resource) pub->__dsTextInputPrivate->showInputPanel(pub, id); __showClient = privateResource->client(); pub->__dsTextInputPrivate->updateInputPanelState(true); - if (pub->__dsTextInputPrivate->getInputPanelState() == DSTextInputPrivate::InputPanelStateWillHide) - { - send_private_command(privateResource->handle, 0, "CONFORMANT_RESTORE"); - } - pub->__dsTextInputPrivate->setInputPanelState(DSTextInputPrivate::InputPanelStateWillShow); - /* TODO: pub->__dsTextInputPrivate->setInputPanelTransientFor(getDSWindow(__activatedResource)); */ } + if (pub->__dsTextInputPrivate->getInputPanelState() == DSTextInputPrivate::InputPanelStateWillHide) + { + send_private_command(privateResource->handle, 0, "CONFORMANT_RESTORE"); + } + + pub->__dsTextInputPrivate->setInputPanelState(DSTextInputPrivate::InputPanelStateWillShow); pub->__geometryUpdated = false; + pub->__dsTextInputPrivate->setInputPanelTransientFor(__clientSurface); } void DSWaylandTextInputPrivate::text_input_destroy(Resource *resource) -- 2.7.4