Skip to content

Commit efaf5ae

Browse files
committed
Make hide() work same as toggle()
This also fixes unreliable tests.
1 parent 44eceed commit efaf5ae

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

src/scriptable/scriptableproxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ void ScriptableProxy::exit()
10731073
void ScriptableProxy::close()
10741074
{
10751075
INVOKE2(close, ());
1076-
m_wnd->close();
1076+
m_wnd->hideWindow();
10771077
}
10781078

10791079
bool ScriptableProxy::focusPrevious()

src/tests/tests.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ class TestInterfaceImpl final : public TestInterface {
430430
settings.beginGroup("Options");
431431
settings.setValue( Config::clipboard_tab::name(), clipboardTabName );
432432
settings.setValue( Config::close_on_unfocus::name(), false );
433+
// Hide the main window even if there is no tray or minimize support.
434+
settings.setValue( Config::hide_main_window::name(), true );
433435
// Exercise limiting rows in Process Manager dialog when testing.
434436
settings.setValue( Config::max_process_manager_rows::name(), 4 );
435437
settings.endGroup();

src/tests/tests.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ private slots:
4848

4949
void commandVisible();
5050
void commandToggle();
51-
void commandHide();
52-
void commandShow();
51+
void commandShowHide();
5352
void commandShowAt();
5453
void commandFocused();
5554

src/tests/tests_scripts.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,7 @@ void Tests::commandToggle()
137137
WAIT_ON_OUTPUT("visible", "true\n");
138138
}
139139

140-
void Tests::commandHide()
141-
{
142-
RUN("visible", "true\n");
143-
RUN("hide", "");
144-
WAIT_ON_OUTPUT("visible", "false\n");
145-
}
146-
147-
void Tests::commandShow()
140+
void Tests::commandShowHide()
148141
{
149142
RUN("visible", "true\n");
150143
RUN("hide", "");

0 commit comments

Comments
 (0)