Fix always-on-top setting on Windows
Recent Gtk+ versions seem to defer creation of native windows even further which made setting HWND_TOPMOST a no-op. Replace this lowlevel hack with the standard Gtk+ way of making a window always-on-top, it now works as expected.
This commit is contained in:
parent
4263ff1e09
commit
68a1dfd5f7
|
@ -49,15 +49,11 @@ gkrellm_winop_reset(void)
|
||||||
void
|
void
|
||||||
gkrellm_winop_options(gint argc, gchar **argv)
|
gkrellm_winop_options(gint argc, gchar **argv)
|
||||||
{
|
{
|
||||||
HWND hWnd = GDK_WINDOW_HWND(gkrellm_get_top_window()->window);
|
|
||||||
|
|
||||||
// This essentially hides the taskbar entry on win32, unfortunately
|
// This essentially hides the taskbar entry on win32, unfortunately
|
||||||
// gtk_window_set_skip_taskbar_hint() is broken in GTK+ 2.14
|
// gtk_window_set_skip_taskbar_hint() does not have any effect
|
||||||
gtk_window_set_type_hint(GTK_WINDOW(gkrellm_get_top_window()), GDK_WINDOW_TYPE_HINT_UTILITY);
|
gtk_window_set_type_hint(GTK_WINDOW(gkrellm_get_top_window()), GDK_WINDOW_TYPE_HINT_UTILITY);
|
||||||
|
|
||||||
// Set stay-on-top flag if requested
|
gkrellm_winop_state_above(_GK.on_top);
|
||||||
if (_GK.on_top)
|
|
||||||
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -344,6 +340,8 @@ gkrellm_winop_state_skip_pager(gboolean state)
|
||||||
void
|
void
|
||||||
gkrellm_winop_state_above(gboolean state)
|
gkrellm_winop_state_above(gboolean state)
|
||||||
{
|
{
|
||||||
|
GtkWindow *window = GTK_WINDOW(gkrellm_get_top_window());
|
||||||
|
gtk_window_set_keep_above(window, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue