Changeset 9a664b6d in mainline


Ignore:
Timestamp:
2024-06-29T18:44:23Z (5 days ago)
Author:
Mohammed Q. Hussain <maastaar@…>
Children:
a3086a4
Parents:
8eeffc1
Message:

Use windows flag to determine if the taskbar should minimize or maximize a window

Location:
uspace/app/taskbar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/types/wndlist.h

    r8eeffc1 r9a664b6d  
    5959        /** Window button rectangle */
    6060        gfx_rect_t rect;
    61         /** Window maximized **/
    62         bool maximized;
    6361} wndlist_entry_t;
    6462
  • uspace/app/taskbar/wndlist.c

    r8eeffc1 r9a664b6d  
    232232
    233233        entry->visible = false;
    234         entry->maximized = true;
    235234
    236235        ui_pbutton_set_light(entry->button, active);
     
    718717{
    719718        wndlist_entry_t *entry = (wndlist_entry_t *)arg;
     719        wndmgt_window_info_t *winfo = NULL;
    720720        sysarg_t dev_id;
     721        errno_t rc;
     722        bool minimized = false;
    721723
    722724        /* ID of device that clicked the button */
    723725        dev_id = entry->wndlist->ev_idev_id;
    724726
    725         if (!entry->maximized) {
     727        rc = wndmgt_get_window_info(entry->wndlist->wndmgt,
     728            entry->wnd_id, &winfo);
     729        if (rc == EOK) {
     730                minimized = (winfo->flags & wndf_minimized) == 0;
     731        }
     732
     733        if (!minimized) {
    726734                (void) wndmgt_activate_window(entry->wndlist->wndmgt,
    727735                dev_id, entry->wnd_id);
    728 
    729                 entry->maximized = true;
    730736        } else {
    731737                (void) wndmgt_deactivate_window(entry->wndlist->wndmgt,
    732738                dev_id, entry->wnd_id);
    733 
    734                 entry->maximized = false;
    735739        }
    736740}
Note: See TracChangeset for help on using the changeset viewer.