Changeset 0d00e53 in mainline


Ignore:
Timestamp:
2024-11-07T10:38:29Z (3 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
9a07ee3, a450088
Parents:
ad9e225
git-author:
Jiri Svoboda <jiri@…> (2024-10-06 18:37:25)
git-committer:
Jiri Svoboda <jiri@…> (2024-11-07 10:38:29)
Message:

Shut down dialog

Location:
uspace
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/hello/hello.h

    rad9e225 r0d00e53  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3737#define HELLO_H
    3838
    39 #include <display.h>
    4039#include <ui/fixed.h>
    4140#include <ui/label.h>
  • uspace/app/meson.build

    rad9e225 r0d00e53  
    7878        'sbi',
    7979        'shutdown',
     80        'shutdown-dlg',
    8081        'sportdmp',
    8182        'stats',
  • uspace/app/shutdown/shutdown.c

    rad9e225 r0d00e53  
    105105        }
    106106
    107         rc = nchoice_set_prompt(nchoice, "Select action");
     107        rc = nchoice_set_prompt(nchoice, "Do you want to shut the system down? "
     108            "Select action:");
    108109        if (rc != EOK) {
    109110                printf(NAME ": Out of memory.\n");
     
    194195
    195196        fibril_mutex_lock(&shutdown.lock);
    196         printf("System is shutting down...\n");
     197        printf("The system is shutting down...\n");
    197198        while (!shutdown.stopped)
    198199                fibril_condvar_wait(&shutdown.cv, &shutdown.lock);
  • uspace/lib/display/include/types/display/wndparams.h

    rad9e225 r0d00e53  
    11/*
    2  * Copyright (c) 2023 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4242        /** Popup window (capture events, no focus) */
    4343        wndf_popup = 0x1,
     44        /** Window does not receive focus */
     45        wndf_nofocus = 0x2,
    4446        /** Topmost window */
    45         wndf_topmost = 0x2,
     47        wndf_topmost = 0x4,
    4648        /** Set specific initial window position */
    47         wndf_setpos = 0x4,
     49        wndf_setpos = 0x8,
    4850        /** Window is minimized */
    49         wndf_minimized = 0x8,
     51        wndf_minimized = 0x10,
    5052        /** Window is maximized */
    51         wndf_maximized = 0x10,
     53        wndf_maximized = 0x20,
    5254        /** Special system window */
    53         wndf_system = 0x20,
     55        wndf_system = 0x40,
    5456        /** Maximized windows should avoid this window */
    55         wndf_avoid = 0x40
     57        wndf_avoid = 0x80
    5658} display_wnd_flags_t;
    5759
  • uspace/lib/ui/include/types/ui/window.h

    rad9e225 r0d00e53  
    5858        /** Place window to the bottom-right corner of the screen */
    5959        ui_wnd_place_bottom_right,
     60        /** Place window to the center of the screen */
     61        ui_wnd_place_center,
    6062        /** Place window accross the entire screen */
    6163        ui_wnd_place_full_screen,
     
    6870        /** Popup window */
    6971        ui_wndf_popup = 0x1,
     72        /** Window does not receive focus */
     73        ui_wndf_nofocus = 0x2,
    7074        /** Topmost window */
    71         ui_wndf_topmost = 0x2,
     75        ui_wndf_topmost = 0x4,
    7276        /** Special system window */
    73         ui_wndf_system = 0x4,
     77        ui_wndf_system = 0x8,
    7478        /** Maximized windows should avoid this window */
    75         ui_wndf_avoid = 0x8
     79        ui_wndf_avoid = 0x10
    7680} ui_wnd_flags_t;
    7781
  • uspace/lib/ui/src/window.c

    rad9e225 r0d00e53  
    189189        switch (params->placement) {
    190190        case ui_wnd_place_default:
    191                 assert(ui_is_fullscreen(window->ui));
     191        case ui_wnd_place_center:
     192                assert(params->placement != ui_wnd_place_default ||
     193                    ui_is_fullscreen(window->ui));
    192194                /* Center window */
    193195                gfx_rect_dims(&params->rect, &dims);
     
    357359        if ((params->flags & ui_wndf_popup) != 0)
    358360                dparams.flags |= wndf_popup;
     361        if ((params->flags & ui_wndf_nofocus) != 0)
     362                dparams.flags |= wndf_nofocus;
    359363        if ((params->flags & ui_wndf_topmost) != 0)
    360364                dparams.flags |= wndf_topmost;
  • uspace/srv/hid/display/seat.c

    rad9e225 r0d00e53  
    492492        /* Focus window on button press */
    493493        if (event->type == PTD_PRESS && event->btn_num == 1) {
    494                 if (wnd != NULL && (wnd->flags & wndf_popup) == 0) {
     494                if (wnd != NULL && (wnd->flags & wndf_popup) == 0 &&
     495                    (wnd->flags & wndf_nofocus) == 0) {
    495496                        ds_seat_set_focus(seat, wnd);
    496497                }
  • uspace/srv/hid/display/window.c

    rad9e225 r0d00e53  
    11/*
    2  * Copyright (c) 2023 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    153153
    154154        /* Is this a popup window? */
    155         if ((params->flags & wndf_popup) != 0)
     155        if ((params->flags & wndf_popup) != 0) {
    156156                ds_seat_set_popup(seat, wnd);
    157         else
    158                 ds_seat_set_focus(seat, wnd);
     157        } else {
     158                if ((params->flags & wndf_nofocus) == 0)
     159                        ds_seat_set_focus(seat, wnd);
     160        }
    159161
    160162        /* Is this window a panel? */
Note: See TracChangeset for help on using the changeset viewer.