Project

General

Profile

Actions

Bug #1435

open

gtk4 client: small letter "c" gets blocked in chat

Added by Alexandr Ignatiev 7 months ago. Updated 2 days ago.

Status:
In Review
Priority:
Normal
Category:
gtk4-client
Target version:
Start date:
05/24/2025
Due date:
% Done:

0%

Estimated time:

Description

Possibly some other markup related letters and some other versions affected. I typed /lua cmd ... but could only /lua Cmd ...


Files

1435.patch (10.7 KB) 1435.patch Dean Brown, 11/23/2025 01:34 AM
1435Main.patch (21 KB) 1435Main.patch Dean Brown, 12/06/2025 04:18 AM
1435_S3_3.patch (10.7 KB) 1435_S3_3.patch Dean Brown, 12/08/2025 02:07 AM

Related issues 1 (1 open0 closed)

Blocks Tasks #1700: Release 3.2.2NewMarko Lindqvist10/11/2025

Actions
Actions #1

Updated by Dean Brown about 2 months ago

  • File 1435.patch added
  • File 1435Main.patch added

Target version could be changed to 3.2.2

Actions #2

Updated by Marko Lindqvist about 1 month ago

  • Target version changed from 3.4.0 to 3.2.2

I would use word 'enable' instead of 'toggle' even though it might actually be enable = FALSE. In our (and gtk, I think) lingo 'toggle' usually means that something goes to the opposite state to what it currently is, not that it goes to specified state (maybe not changing at all).

Actions #3

Updated by Dean Brown 29 days ago

  • File deleted (1435.patch)
Actions #4

Updated by Dean Brown 29 days ago

  • File deleted (1435Main.patch)
Actions #5

Updated by Dean Brown 29 days ago

  • File 1435.patch added
  • File 1435Main.patch added

The fix for #1718, which added menu items to change sound volume using "<" and ">" keys, caused those characters to also get blocked in the chat line. This patch also fixes that, for S3_2 and S3_3. Main does not appear to have the #1718 patch yet.

Actions #6

Updated by Dean Brown 28 days ago

  • File 1435Main.patch added

oops, my bad. I failed to refresh/pull my Main clone. Main does have the #1718 patch. Corrected the 1435Main.patch

Actions #7

Updated by Dean Brown 28 days ago

  • File deleted (1435Main.patch)
Actions #8

Updated by Marko Lindqvist 28 days ago

Dean Brown wrote in #note-5:

The fix for #1718, which added menu items to change sound volume using "<" and ">" keys, caused those characters to also get blocked in the chat line.

So, there's currently a regression relative to 3.2.1. Makes this fix release critical (blocker) for 3.2.2.

Actions #9

Updated by Marko Lindqvist 28 days ago

Actions #10

Updated by Marko Lindqvist 28 days ago

Doesn't making the volume menu entries MGROUP_PLAYER cause e.g. them to be always disabled for global observers? In any case that is quite a hack, misusing the group definition.

Actions #11

Updated by Marko Lindqvist 28 days ago

I think the volume keys issue deserves ticket of its own, as it's different and separate change to the 'c' issue. (It's now a bit unfortunate that you deleted your earlier patches that did what this ticket is about)

Actions #12

Updated by Marko Lindqvist 28 days ago

You shouldn't unconditionally enable all menu items when chatline loses focus - they might should be disabled for other reasons.

Actions #13

Updated by Dean Brown 27 days ago

Thinking more about this -

You shouldn't unconditionally enable all menu items when chatline loses focus - they might should be disabled for other reasons.

Good point, the code in il_lost_focus() should stay as is, just calling real_menus_update();

The current code in il_gained_focus() is also misusing the group definition. I thought when making the volume menu entries MGROUP_PLAYER that was a hack, but calling menus_disable_unit_commands() is also a hack. I have 2 proposals for doing the Right Thing in il_gained_focus() -

1 use code like this, modeled on menu_entry_group_set_sensitive()

  int i;

  for (i = 0; menu_entries[i].key != NULL; i++) {
    if ( Some test of menu_entries[i].accl ) {
      menu_entry_set_sensitive_info(map, &(menu_entries[i]), FALSE);
    }
  }

where "Some test of" means checking for NULL and if not NULL then looking for ACCL_MOD_KEY.

2 Redo the group definition system by changing the enum menu_entry_grouping so that the values are bit flags, e.g.

enum menu_entry_grouping { MGROUP_SAFE = 0B00000001, MGROUP_EDIT = 0B00000010, ...

and add MGROUP_CHAR = 0B01000000. Then the individual menu_entries can have > 1 MGROUP_XXX's or'd together, e.g.

  { "VOLUME_UP", N_("Volume Up"),
    "volume_up", "greater", MGROUP_SAFE | MGROUP_CHAR,
    NULL, FALSE },

Have to rewrite all code that deals with enum menu_entry_grouping.
Actions #14

Updated by Marko Lindqvist 27 days ago

I wonder if we could simply disable menus completely / disable all menu entries. "Entries with shortcut" are their functionality-wise random (odd) selection to have disabled, and user is not going to use shortcuts of those entries that don't have one, even if they would be enabled.
I just am not sure what it would do to accessing menus with a mouse when focus has been in chatline before that attempted menu access. Likely one couldn't click menus at all, so one would need to do extra click somewhere else for moving the focus.

Actions #15

Updated by Dean Brown 26 days ago

I'm OK with disable menus completely / disable all menu entries. Could make an argument that the Quit item should be available.

If il_gained_focus() calls enable_menus(FALSE); then il_lost_focus() needs to call enable_menus(TRUE); and doesn't need to call real_menus_update(); - what happens then is the whole menu bar disappears/reappears, which is a bit disconcerting. But the question of accessing menus while chatline has focus is moot, can't access what's not there.

il_gained_focus() cannot call menu_entry_group_set_sensitive(G_ACTION_MAP(gui_app()), MGROUP_ALL, FALSE); directly because the enum is local to menu.c, need another routine in menu.c menus_disable_all_commands(). When I tried this it didn't work well - real_menus_update() failed to restore some items (notably "Quit" and "F1" - "F12"). Bugs here? Or real_menus_update() needs to do more. Would need more digging. You can still access the menus.

Actions #16

Updated by Dean Brown 26 days ago

Changed my mind about disable menus completely / disable all menu entries. I use the "Merged" setting for client option "Messages and Chat reports location", so when I'm in the Chat tab I can't see the map view. When chat has focus, I would still want F1 to switch to the map view, so F1 menu item would have to be still enabled.

Actions #17

Updated by Dean Brown 20 days ago

Going back to my 2 suggestions - I can see tradeoffs for either but decided I like the bit flags approach better. See if you like these new patches.

Also found an independent problem that real_menus_update() didn't re-enable the entries for CENTER_VIEW, VOLUME_UP & VOLUME_DOWN.

Actions #18

Updated by Dean Brown 20 days ago

  • File deleted (1435.patch)
Actions #19

Updated by Dean Brown 20 days ago

  • File deleted (1435Main.patch)
Actions #20

Updated by Marko Lindqvist 14 days ago

Patch does not apply to S3_3. I guess it needs patch of its own (the existing patches apply to main & S3_2, and are in my work trees of those branches now)

Actions #21

Updated by Marko Lindqvist 13 days ago

Dean Brown wrote in #note-15:

real_menus_update() failed to restore some items (notably "Quit" and "F1" - "F12"). Bugs here?

real_menus_update() never makes sensitive those menu items that cannot go insensitive in the first place. So when you make it possible for new items to go insensitive, you need to also add the code to make them sensitive again.

Actions #22

Updated by Dean Brown 12 days ago

  • File 1435_S3_3.patch added

real_menus_update() never makes sensitive those menu items that cannot go insensitive in the first place. So when you make it possible for new items to go insensitive, you need to also add the code to make them sensitive again.

Latest patches take care of this.

Added 1435_S3_3.patch

Actions #23

Updated by Marko Lindqvist 12 days ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
Actions #24

Updated by Marko Lindqvist 9 days ago

  • Status changed from In Review to In Progress
  • Assignee changed from Marko Lindqvist to Dean Brown

Noticed on main: A)utoworker does not work with this patch. The entry is completely gone from the menus.

Actions #25

Updated by Dean Brown 7 days ago

Fixed 1435Main.patch

Actions #26

Updated by Dean Brown 7 days ago

  • File deleted (1435Main.patch)
Actions #27

Updated by Marko Lindqvist 5 days ago

Marko Lindqvist wrote in #note-24:

Noticed on main: A)utoworker does not work with this patch. The entry is completely gone from the menus.

Same bug is also in S3_3.

Actions #28

Updated by Dean Brown 5 days ago

  • File deleted (1435_S3_3.patch)
Actions #29

Updated by Dean Brown 5 days ago

fixed 1435_S3_3.patch

Actions #30

Updated by Marko Lindqvist 2 days ago

  • Status changed from In Progress to In Review
  • Assignee changed from Dean Brown to Marko Lindqvist
Actions

Also available in: Atom PDF