Changeset 9aa51406 in mainline for uspace/app/terminal/terminal.c


Ignore:
Timestamp:
2024-09-18T10:01:34Z (4 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
88739997
Parents:
1bbc6dc
git-author:
Jiri Svoboda <jiri@…> (2024-09-17 17:01:07)
git-committer:
Jiri Svoboda <jiri@…> (2024-09-18 10:01:34)
Message:

Create terminal window with the correct size from the start.

File:
1 edited

Legend:

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

    r1bbc6dc r9aa51406  
    10021002{
    10031003        gfx_rect_t min_rect = { { 0, 0 }, { min_width, min_height } };
     1004        gfx_rect_t wmin_rect;
     1005        gfx_rect_t wrect;
    10041006
    10051007        ui_wnd_params_t wparams;
     
    10171019
    10181020        /* Compute wrect such that application area corresponds to rect. */
    1019         gfx_rect_t wrect;
    10201021        ui_wdecor_rect_from_app(term->ui, wparams.style, &min_rect, &wrect);
    1021         gfx_rect_rtranslate(&wrect.p0, &wrect, &wparams.rect);
     1022        gfx_rect_rtranslate(&wrect.p0, &wrect, &wmin_rect);
     1023        wparams.min_size = wmin_rect.p1;
     1024
     1025        gfx_rect_t rect = { { 0, 0 }, { width, height } };
     1026        ui_wdecor_rect_from_app(term->ui, wparams.style, &rect, &rect);
     1027        term->off = rect.p0;
     1028        gfx_rect_rtranslate(&term->off, &rect, &wparams.rect);
    10221029
    10231030        rc = ui_window_create(term->ui, &wparams, &term->window);
     
    10251032                return rc;
    10261033
    1027         gfx_rect_t rect = { { 0, 0 }, { width, height } };
    1028         ui_wdecor_rect_from_app(term->ui, wparams.style, &rect, &rect);
    1029         term->off = rect.p0;
    1030         gfx_rect_rtranslate(&term->off, &rect, &wrect);
    1031 
    1032         ui_window_resize(term->window, &wrect);
    10331034        ui_window_set_cb(term->window, &terminal_window_cb, (void *) term);
    1034 
    10351035        return terminal_window_resize(term);
    10361036}
Note: See TracChangeset for help on using the changeset viewer.