Skip to content

Commit

Permalink
Merge pull request #1110 from reupen/hide-while-hidden
Browse files Browse the repository at this point in the history
Fix taskbar entry appearing when using hide command while already hidden
  • Loading branch information
reupen authored Jan 29, 2025
2 parents 1f8e088 + cac12bb commit 3dab03a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
‘Automatic anti-aliasing’ or ‘GDI-compatible, no anti-aliasing’ based on the
system ‘Smooth edges of screen fonts’ setting.

### Bug fixes

- A bug was fixed where foobar2000 incorrectly appeared in the taskbar when
using the View/Hide menu command or the /hide command-line argument while
foobar2000 was minimised to the system tray.
[[#1110](https://github.com/reupen/columns_ui/pull/1110)]

### Internal changes

- `ui_config_callback::ui_fonts_changed()` is now called once instead of
Expand Down
15 changes: 8 additions & 7 deletions foo_ui_columns/user_interface_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,21 @@ class UserInterfaceImpl : public user_interface_v3 {
SetForegroundWindow(main_window.get_wnd());
}
}

void hide() override
{
if (main_window.get_wnd()) {
if (is_visible())
ShowWindow(main_window.get_wnd(), SW_MINIMIZE);
}
}

bool is_visible() override
{
bool rv = false;
if (main_window.get_wnd()) {
rv = IsWindowVisible(main_window.get_wnd()) && !IsIconic(main_window.get_wnd());
}
return rv;
if (main_window.get_wnd())
return IsWindowVisible(main_window.get_wnd()) && !IsIconic(main_window.get_wnd());

return false;
}

void override_statusbar_text(const char* p_text) override
{
status_bar::set_menu_item_description(p_text);
Expand Down

0 comments on commit 3dab03a

Please sign in to comment.