Changeset 788c76e3 in mainline


Ignore:
Timestamp:
2023-10-10T19:14:38Z (7 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5d9403d5
Parents:
c0efb2e
Message:

GFX demo should downsize the window with -d cons@ ui

Also do not return task value if the ui is fullscreen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/gfxdemo/gfxdemo.c

    rc0efb2e r788c76e3  
    11091109        gfx_rect_t wrect;
    11101110        gfx_coord2_t off;
     1111        gfx_rect_t ui_rect;
     1112        gfx_coord2_t dims;
    11111113        errno_t rc;
    11121114
     
    11141116        if (rc != EOK) {
    11151117                printf("Error initializing UI (%s)\n", display_spec);
     1118                goto error;
     1119        }
     1120
     1121        rc = ui_get_rect(ui, &ui_rect);
     1122        if (rc != EOK) {
     1123                printf("Error getting display size.\n");
    11161124                goto error;
    11171125        }
     
    11331141        gfx_rect_rtranslate(&off, &wrect, &params.rect);
    11341142
     1143        gfx_rect_dims(&ui_rect, &dims);
     1144
     1145        /* Make sure window is not larger than the entire screen */
     1146        if (params.rect.p1.x > dims.x)
     1147                params.rect.p1.x = dims.x;
     1148        if (params.rect.p1.y > dims.y)
     1149                params.rect.p1.y = dims.y;
     1150
    11351151        rc = ui_window_create(ui, &params, &window);
    11361152        if (rc != EOK) {
     
    11471163        }
    11481164
    1149         task_retval(0);
    1150 
    1151         rc = demo_loop(gc, rect.p1.x, rect.p1.y);
     1165        ui_window_get_app_rect(window, &rect);
     1166        gfx_rect_dims(&rect, &dims);
     1167
     1168        if (!ui_is_fullscreen(ui))
     1169                task_retval(0);
     1170
     1171        rc = demo_loop(gc, dims.x, dims.y);
    11521172        if (rc != EOK)
    11531173                goto error;
Note: See TracChangeset for help on using the changeset viewer.