Changeset 46a47c0 in mainline for uspace/app/terminal/terminal.c


Ignore:
Timestamp:
2023-01-16T20:34:01Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b0ae23f
Parents:
b3eeae5
Message:

Make sure window is only show as inactive when it loses last focus

This currently affects the title bar and also the cursor in Terminal.

File:
1 edited

Legend:

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

    rb3eeae5 r46a47c0  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * Copyright (c) 2012 Petr Koupy
    44 * All rights reserved.
     
    118118
    119119static void terminal_close_event(ui_window_t *, void *);
    120 static void terminal_focus_event(ui_window_t *, void *);
     120static void terminal_focus_event(ui_window_t *, void *, unsigned);
    121121static void terminal_kbd_event(ui_window_t *, void *, kbd_event_t *);
    122122static void terminal_pos_event(ui_window_t *, void *, pos_event_t *);
    123 static void terminal_unfocus_event(ui_window_t *, void *);
     123static void terminal_unfocus_event(ui_window_t *, void *, unsigned);
    124124
    125125static ui_window_cb_t terminal_window_cb = {
     
    833833
    834834/** Handle window focus event. */
    835 static void terminal_focus_event(ui_window_t *window, void *arg)
     835static void terminal_focus_event(ui_window_t *window, void *arg,
     836    unsigned nfocus)
    836837{
    837838        terminal_t *term = (terminal_t *) arg;
    838839
     840        (void)nfocus;
    839841        term->is_focused = true;
    840842        term_update(term);
     
    878880
    879881/** Handle window unfocus event. */
    880 static void terminal_unfocus_event(ui_window_t *window, void *arg)
     882static void terminal_unfocus_event(ui_window_t *window, void *arg,
     883    unsigned nfocus)
    881884{
    882885        terminal_t *term = (terminal_t *) arg;
    883886
    884         term->is_focused = false;
    885         term_update(term);
    886         gfx_update(term->gc);
     887        if (nfocus == 0) {
     888                term->is_focused = false;
     889                term_update(term);
     890                gfx_update(term->gc);
     891        }
    887892}
    888893
Note: See TracChangeset for help on using the changeset viewer.