Changes in uspace/lib/ui/src/ui.c [983052c:b1f0a14] in mainline


Ignore:
File:
1 edited

Legend:

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

    r983052c rb1f0a14  
    338338        switch (event->type) {
    339339        case CEV_KEY:
    340                 ui_lock(ui);
    341340                ui_window_send_kbd(awnd, &event->ev.key);
    342                 ui_unlock(ui);
    343341                break;
    344342        case CEV_POS:
     
    350348                claim = ui_wdecor_pos_event(awnd->wdecor, &pos);
    351349                /* Note: If event is claimed, awnd might not be valid anymore */
    352                 if (claim == ui_unclaimed) {
    353                         ui_lock(ui);
     350                if (claim == ui_unclaimed)
    354351                        ui_window_send_pos(awnd, &pos);
    355                         ui_unlock(ui);
    356                 }
    357352
    358353                break;
     
    459454errno_t ui_suspend(ui_t *ui)
    460455{
    461         errno_t rc;
    462 
    463         assert(!ui->suspended);
    464 
    465         if (ui->cgc == NULL) {
    466                 ui->suspended = true;
     456        if (ui->cgc == NULL)
    467457                return EOK;
    468         }
    469458
    470459        (void) console_set_caption(ui->console, "");
    471         rc = console_gc_suspend(ui->cgc);
    472         if (rc != EOK)
    473                 return rc;
    474 
    475         ui->suspended = true;
    476         return EOK;
     460        return console_gc_suspend(ui->cgc);
    477461}
    478462
     
    493477        cons_event_t ev;
    494478
    495         assert(ui->suspended);
    496 
    497         if (ui->cgc == NULL) {
    498                 ui->suspended = false;
     479        if (ui->cgc == NULL)
    499480                return EOK;
    500         }
    501481
    502482        rc = console_get_pos(ui->console, &col, &row);
     
    530510                return rc;
    531511
    532         ui->suspended = false;
    533 
    534512        awnd = ui_window_get_active(ui);
    535513        if (awnd != NULL)
    536514                (void) console_set_caption(ui->console, awnd->wdecor->caption);
    537515
    538         rc = gfx_cursor_set_visible(console_gc_get_ctx(ui->cgc), false);
    539         if (rc != EOK)
    540                 return rc;
    541 
    542         return EOK;
    543 }
    544 
    545 /** Determine if UI is suspended.
    546  *
    547  * @param ui UI
    548  * @return @c true iff UI is suspended
    549  */
    550 bool ui_is_suspended(ui_t *ui)
    551 {
    552         return ui->suspended;
     516        return gfx_cursor_set_visible(console_gc_get_ctx(ui->cgc), false);
    553517}
    554518
Note: See TracChangeset for help on using the changeset viewer.