Skip to content

Commit 8e9040c

Browse files
authored
Reset hover index when window is updated or hide (#1168)
Fix #1167
1 parent 66a729a commit 8e9040c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/ui/classic/inputwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,10 @@ void InputWindow::setTextToLayout(
271271
}
272272

273273
std::pair<int, int> InputWindow::update(InputContext *inputContext) {
274+
hoverIndex_ = -1;
274275
if ((parent_->suspended() &&
275276
parent_->instance()->currentUI() != "kimpanel") ||
276277
!inputContext) {
277-
hoverIndex_ = -1;
278278
visible_ = false;
279279
return {0, 0};
280280
}

src/ui/classic/waylandinputwindow.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
*
66
*/
77
#include "waylandinputwindow.h"
8-
#include <cstddef>
9-
#include "fcitx/misc_p.h"
108
#include "common.h"
119
#include "waylandim_public.h"
1210
#include "waylandui.h"
1311
#include "waylandwindow.h"
1412
#include "wl_compositor.h"
1513
#include "wl_region.h"
16-
#include "wp_fractional_scale_manager_v1.h"
1714
#include "zwp_input_method_v2.h"
1815
#include "zwp_input_panel_v1.h"
19-
#include "zwp_input_popup_surface_v2.h"
2016

2117
#ifdef __linux__
2218
#include <linux/input-event-codes.h>
@@ -151,6 +147,7 @@ void WaylandInputWindow::update(fcitx::InputContext *ic) {
151147

152148
if (!visible()) {
153149
CLASSICUI_DEBUG() << "Hide Wayland Input Window.";
150+
hoverIndex_ = -1;
154151
window_->hide();
155152
repaintIC_.unwatch();
156153
panelSurface_.reset();

src/ui/classic/xcbinputwindow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ void XCBInputWindow::update(InputContext *inputContext) {
165165
if (!visible()) {
166166
if (oldVisible) {
167167
xcb_unmap_window(ui_->connection(), wid_);
168+
hoverIndex_ = -1;
168169
}
169170
return;
170171
}

0 commit comments

Comments
 (0)