Changeset 5a43bd0 in mainline
- Timestamp:
- 2020-10-23T17:16:09Z (4 years ago)
- 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)
- Location:
- uspace/app/terminal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/terminal/terminal.c
rdcfd422 r5a43bd0 298 298 bool front_visibility = 299 299 chargrid_get_cursor_visibility(term->frontbuf) && 300 /*term->widget.window->is_focused*/true;300 term->is_focused; 301 301 bool back_visibility = 302 302 chargrid_get_cursor_visibility(term->backbuf); … … 695 695 ui_wdecor_set_active(term->wdecor, true); 696 696 ui_wdecor_paint(term->wdecor); 697 698 term->is_focused = true; 699 term_update(term); 697 700 } 698 701 } … … 713 716 static void terminal_pos_event(void *arg, pos_event_t *event) 714 717 { 718 cons_event_t cevent; 715 719 terminal_t *term = (terminal_t *) arg; 716 720 … … 720 724 721 725 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 } 722 740 } 723 741 … … 730 748 ui_wdecor_set_active(term->wdecor, false); 731 749 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 } 755 755 756 756 /** Window decoration requested window closure. … … 869 869 gfx_rect_rtranslate(&off, &wrect, &wparams.rect); 870 870 871 term->off = off; 872 871 873 rc = display_window_create(display, &wparams, &terminal_wnd_cb, 872 874 (void *) term, &term->window); … … 941 943 getterm(vc, "/app/bdsh"); 942 944 943 term_repaint(term);944 945 945 term->update.p0.x = 0; 946 946 term->update.p0.y = 0; 947 947 term->update.p1.x = 0; 948 948 term->update.p1.y = 0; 949 950 term_repaint(term); 949 951 950 952 *rterm = term; -
uspace/app/terminal/terminal.h
rdcfd422 r5a43bd0 62 62 sysarg_t h; 63 63 gfx_rect_t update; 64 gfx_coord2_t off; 65 bool is_focused; 64 66 65 67 ui_resource_t *ui_res;
Note:
See TracChangeset
for help on using the changeset viewer.