Minimize an active window when its entry is clicked in the taskbar#234
Minimize an active window when its entry is clicked in the taskbar#234MaaSTaaR wants to merge 2 commits intoHelenOS:masterfrom
Conversation
| rc = wndmgt_get_window_info(entry->wndlist->wndmgt, | ||
| entry->wnd_id, &winfo); | ||
| if (rc == EOK) { | ||
| minimized = (winfo->flags & wndf_minimized) == 0; |
There was a problem hiding this comment.
Note that the logic is reversed w.r.t. the name of the variable: minimized will be true iff the window is not minimized
| if (!minimized) { | ||
| (void) wndmgt_activate_window(entry->wndlist->wndmgt, | ||
| dev_id, entry->wnd_id); | ||
| } else { |
There was a problem hiding this comment.
Now here's the big problem. If you click the button of a window that's not minimized and is not focused, instead of activating the window it will minimize it. Also note that with multiple seats, each window can have zero, one or more foci. A window should only be minimized if it is the focus of the same seat that clicked the window button. For example, you might add a WM operation to test if a particular window is focused by a particular seat (which is specified via input device ID).
| (void) wndmgt_activate_window(entry->wndlist->wndmgt, | ||
| dev_id, entry->wnd_id); | ||
| } else { | ||
| (void) wndmgt_deactivate_window(entry->wndlist->wndmgt, |
There was a problem hiding this comment.
I think the operation should simply be called 'minimize', because that's what it does (this pertains to all other places too).
|
|
||
| if (!minimized) { | ||
| (void) wndmgt_activate_window(entry->wndlist->wndmgt, | ||
| dev_id, entry->wnd_id); |
There was a problem hiding this comment.
The indentation is incorrect. Did you run 'make ccheck'?
| wndmgt_window_info_t **); | ||
| extern void wndmgt_free_window_info(wndmgt_window_info_t *); | ||
| extern errno_t wndmgt_activate_window(wndmgt_t *, sysarg_t, sysarg_t); | ||
| extern errno_t wndmgt_deactivate_window(wndmgt_t *, sysarg_t, sysarg_t); |
There was a problem hiding this comment.
For this new operation unit tests should be added to /data/helenos/master/uspace/lib/wndmgt/test/wndmgt.c, similar to PCUT_TEST(activate_window_failure) and PCUT_TEST(activate_window_success).
No description provided.