winex11.drv: Add a some heuristics when to add a maximize or fullscreen hint.

This commit is contained in:
Dmitry Timoshkov 2008-03-18 22:25:33 +08:00 committed by Alexandre Julliard
parent 2182d4600a
commit 79274bf0f5
1 changed files with 12 additions and 5 deletions

View File

@ -183,16 +183,23 @@ static void update_net_wm_states( Display *display, struct x11drv_win_data *data
if (!data->mapped) return;
style = GetWindowLongW( data->hwnd, GWL_STYLE );
if (style & WS_MAXIMIZE) new_state |= (1 << NET_WM_STATE_MAXIMIZED);
if (!(style & WS_MAXIMIZE) &&
data->whole_rect.left <= 0 && data->whole_rect.right >= screen_width &&
if (data->whole_rect.left <= 0 && data->whole_rect.right >= screen_width &&
data->whole_rect.top <= 0 && data->whole_rect.bottom >= screen_height)
new_state |= (1 << NET_WM_STATE_FULLSCREEN);
{
if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION)
new_state |= (1 << NET_WM_STATE_MAXIMIZED);
else
new_state |= (1 << NET_WM_STATE_FULLSCREEN);
}
else if (style & WS_MAXIMIZE)
new_state |= (1 << NET_WM_STATE_MAXIMIZED);
ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
if (ex_style & WS_EX_TOPMOST)
{
new_state |= (1 << NET_WM_STATE_ABOVE);
ERR("switching window %p/%lx to STATE_ABOVE\n", data->hwnd, data->whole_window);
}
if (ex_style & WS_EX_TOOLWINDOW)
new_state |= (1 << NET_WM_STATE_SKIP_TASKBAR) | (1 << NET_WM_STATE_SKIP_PAGER);