Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a85d5c6 in mainline


Ignore:
Timestamp:
2021-03-16T22:33:16Z (4 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
7d83c54
Parents:
36795edf
git-author:
Jiri Svoboda <jiri@…> (2021-03-16 22:32:28)
git-committer:
Jiri Svoboda <jiri@…> (2021-03-16 22:33:16)
Message:

Fix window resize when not using window double-buffer

We can only create the direct mapped bitmap after the window has been
resized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/window.c

    r36795edf ra85d5c6  
    393393        /* mgc != NULL iff client-side rendering */
    394394        if (window->mgc != NULL) {
    395                 /* Resize window bitmap */
     395#ifdef CONFIG_WIN_DOUBLE_BUF
     396                /*
     397                 * Create new window bitmap in advance. If direct mapping,
     398                 * will need do it after resizing the window.
     399                 */
    396400                assert(window->bmp != NULL);
    397 
    398401                gfx_bitmap_params_init(&win_params);
    399 #ifndef CONFIG_WIN_DOUBLE_BUF
    400                 win_params.flags |= bmpf_direct_output;
    401 #endif
    402402                win_params.rect = nrect;
    403403
     
    410410                if (rc != EOK)
    411411                        goto error;
     412#endif
    412413        }
    413414
     
    443444        }
    444445
    445         /* CLient side rendering? */
     446        /* Client side rendering? */
    446447        if (window->mgc != NULL) {
     448#ifndef CONFIG_WIN_DOUBLE_BUF
     449                /* Window is resized, now we can map the window bitmap again */
     450                gfx_bitmap_params_init(&win_params);
     451                win_params.flags |= bmpf_direct_output;
     452                win_params.rect = nrect;
     453
     454                rc = gfx_bitmap_create(window->realgc, &win_params, NULL,
     455                    &win_bmp);
     456                if (rc != EOK)
     457                        goto error;
     458
     459                rc = gfx_bitmap_get_alloc(win_bmp, &win_alloc);
     460                if (rc != EOK)
     461                        goto error;
     462#endif
     463
    447464                mem_gc_retarget(window->mgc, &win_params.rect, &win_alloc);
    448465
Note: See TracChangeset for help on using the changeset viewer.