Changeset 5a43bd0 in mainline


Ignore:
Timestamp:
2020-10-23T17:16:09Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f7a90df
Parents:
dcfd422
git-author:
Jiri Svoboda <jiri@…> (2020-10-23 17:10:33)
git-committer:
Jiri Svoboda <jiri@…> (2020-10-23 17:16:09)
Message:

Fix terminal nits

Location:
uspace/app/terminal
Files:
2 edited

Legend:

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

    rdcfd422 r5a43bd0  
    298298        bool front_visibility =
    299299            chargrid_get_cursor_visibility(term->frontbuf) &&
    300             /*term->widget.window->is_focused*/true;
     300            term->is_focused;
    301301        bool back_visibility =
    302302            chargrid_get_cursor_visibility(term->backbuf);
     
    695695                ui_wdecor_set_active(term->wdecor, true);
    696696                ui_wdecor_paint(term->wdecor);
     697
     698                term->is_focused = true;
     699                term_update(term);
    697700        }
    698701}
     
    713716static void terminal_pos_event(void *arg, pos_event_t *event)
    714717{
     718        cons_event_t cevent;
    715719        terminal_t *term = (terminal_t *) arg;
    716720
     
    720724
    721725        ui_wdecor_pos_event(term->wdecor, event);
     726
     727        sysarg_t sx = -term->off.x;
     728        sysarg_t sy = -term->off.y;
     729
     730        if (event->type == POS_PRESS) {
     731                cevent.type = CEV_POS;
     732                cevent.ev.pos.type = event->type;
     733                cevent.ev.pos.pos_id = event->pos_id;
     734                cevent.ev.pos.btn_num = event->btn_num;
     735
     736                cevent.ev.pos.hpos = (event->hpos - sx) / FONT_WIDTH;
     737                cevent.ev.pos.vpos = (event->vpos - sy) / FONT_SCANLINES;
     738                terminal_queue_cons_event(term, &cevent);
     739        }
    722740}
    723741
     
    730748                ui_wdecor_set_active(term->wdecor, false);
    731749                ui_wdecor_paint(term->wdecor);
    732         }
    733 }
    734 
    735 #if 0
    736 static void terminal_handle_position_event(widget_t *widget, pos_event_t pos_event)
    737 {
    738         cons_event_t event;
    739         terminal_t *term = (terminal_t *) widget;
    740         sysarg_t sx = term->widget.hpos;
    741         sysarg_t sy = term->widget.vpos;
    742 
    743         if (pos_event.type == POS_PRESS) {
    744                 event.type = CEV_POS;
    745                 event.ev.pos.type = pos_event.type;
    746                 event.ev.pos.pos_id = pos_event.pos_id;
    747                 event.ev.pos.btn_num = pos_event.btn_num;
    748 
    749                 event.ev.pos.hpos = (pos_event.hpos - sx) / FONT_WIDTH;
    750                 event.ev.pos.vpos = (pos_event.vpos - sy) / FONT_SCANLINES;
    751                 terminal_queue_cons_event(term, &event);
    752         }
    753 }
    754 #endif
     750
     751                term->is_focused = false;
     752                term_update(term);
     753        }
     754}
    755755
    756756/** Window decoration requested window closure.
     
    869869        gfx_rect_rtranslate(&off, &wrect, &wparams.rect);
    870870
     871        term->off = off;
     872
    871873        rc = display_window_create(display, &wparams, &terminal_wnd_cb,
    872874            (void *) term, &term->window);
     
    941943        getterm(vc, "/app/bdsh");
    942944
    943         term_repaint(term);
    944 
    945945        term->update.p0.x = 0;
    946946        term->update.p0.y = 0;
    947947        term->update.p1.x = 0;
    948948        term->update.p1.y = 0;
     949
     950        term_repaint(term);
    949951
    950952        *rterm = term;
  • uspace/app/terminal/terminal.h

    rdcfd422 r5a43bd0  
    6262        sysarg_t h;
    6363        gfx_rect_t update;
     64        gfx_coord2_t off;
     65        bool is_focused;
    6466
    6567        ui_resource_t *ui_res;
Note: See TracChangeset for help on using the changeset viewer.