Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Screen list" and related M-`, M-{ and M-} do not work from "find file" list #2967

Open
mc-butler opened this issue Feb 20, 2013 · 9 comments
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2967
Reporter szaszg (szaszg@….inter.net)
Mentions gotar@….pl

From panels: Find File -> open a file from the list and now M-`, M-{ and M-} hotkeys do not work.

Note

Original attachments:

  • mc.modal.diff (raw) by szaszg (szaszg@….inter.net) on Feb 18, 2014 at 22:12 UTC
@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 21, 2013 at 4:21 UTC (comment 1)

  • Resolution set to wontfix
  • Status changed from new to closed
  • Milestone Future Releases deleted

Editor/viewer opened from find result is modal and doesn't provide switch to another screen. This is a feature.

@mc-butler
Copy link
Author

Changed by szaszg (szaszg@….inter.net) on Feb 21, 2013 at 18:19 UTC (comment 2)

Hmm.. This is not a feature, this is a very annoying behavior.

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Mar 15, 2013 at 15:05 UTC (comment 3)

  • Cc set to gotar@….pl

@mc-butler
Copy link
Author

Changed by szaszg (szaszg@….inter.net) on Feb 18, 2014 at 22:12 UTC

@mc-butler
Copy link
Author

Changed by szaszg (szaszg@….inter.net) on Feb 18, 2014 at 22:13 UTC (comment 4)

  • Status changed from closed to reopened
  • Resolution wontfix deleted

I was thinking a lot of about this "feature"...

But I did not realize what it's for...

So, i upload a patch to fix this annoying thing.

This patch changes 8 little thing:

  1. lib/widget/dialog.h:

adds a new dlg_flag: DLG_ALLOW_SL -> allow ScreenList (and Prev / Next) for this dialog even if modal

  1. and 3. src/filemanager/find.c:find_parameters ():

uses this new flag for creating dialogs to allow "screen switching" from find file

4., 5. and 6. lib/widget/dialog.c:dlg_execute_cmd ():

allows "screen switching" for dialogs flagged by DLG_ALLOW_SL too

  1. lib/widget/dialog.c:dlg_init ()

remove the code that marks non-modal dialogs as modal

  1. lib/widget/dialog-switch.c:dialog_switch_remove ()

changes the code for select "current dialog" to always select the first dialog ([main]) after user close one...

The last one is a crucial step... because the whole dialog switching code is quite hmm... "hacky"

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 19, 2014 at 4:42 UTC (comment 4.5)

Replying to szaszg:

The last one is a crucial step... because the whole dialog switching code is quite hmm... "hacky"

Yes. And DLG_ALLOW_SL is a hack for hack.

@mc-butler
Copy link
Author

Changed by szaszg (szaszg@….inter.net) on Feb 19, 2014 at 5:42 UTC (comment 5.6)

Replying to andrew_b:

Yes. And DLG_ALLOW_SL is a hack for hack.

Hmm.. I don't think so... this is just a dialog flag wich allow the key combos to works with the flagged ones... where is the "hack"???

Not the DLG_ALLOW_SL is a hack (or "hack of the hack"), maximum the 8th step: we cannot select a dialog after remove one freely and we always switch back to [main] dialog in dialog_switch_remove(). But this is neccessary because, when editor (and maybe viewer) ends it explicitly update the [main] dialog (even dialog_switch_remove() select an other dialog) with update_panels(), and so [main]->[find file] gain the "focus" not the "selected" one...

So, if somebody rewrite the whole code (of dialog switching), than this 8th step (mc_current = g_list_last(mc_dialog);) may be rewriten too (e.g. to select the previouse dialog, if one closed).
So really the 8th step is not a "hack", just a "neccessity".

(BTW IMHO the hackiest part of the dialog switching code, is the dialog_switch_goto() and everything around them ... :-)

@mc-butler
Copy link
Author

Changed by szaszg (szaszg@….inter.net) on Feb 19, 2014 at 8:52 UTC (comment 7)

BTW.: I am very pleased to talk about this ;-)

May i ask:

  • the modal "flag" why not one of the dialogs' flags? Is there any significance?
  • is there any other intention of the modal "flag", or it just because "ScreenList" things?
  • because MC just a "half-way" event-driven the modal name is a little bit misleading (at the present implementation), isn't it?

Just a word about "DLG_ALLOW_SL is hacky" thing again:

I thinking about it, but i cannot see how we implement this thing cleaner even now or later if the modal and dialog stuff will work similar than other event driven GUI systems... ?
If you have a cleaner implementation plan than "using a flag in the dialog widget to allow ScreenList stuff works/not works", please... :-)

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 18, 2015 at 18:30 UTC (comment 8)

  • Milestone set to Future Releases

@mc-butler mc-butler reopened this Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Development

No branches or pull requests

1 participant