NsCDE / NsCDE

Modern and functional CDE desktop based on FVWM
Other
1.92k stars 56 forks source link

[Question] How to debug NsCDE's Splash Screen? #53

Closed leoctrl closed 3 years ago

leoctrl commented 3 years ago

Hi, more often than not, especially at first login after power on or reboot, I experience an annoying freeze of the Splash Screen: the "wheel" to the right of "Starting Up..." stops rotating, the mouse pointer turns to cross hairs, Ctrl+C or mouse click does nothing, eventually after a number of alternate Esc / mouse clicks the Splash Screen goes away. As I'm quite unfamiliar with Fvwm (i.e. I haven't got the faintest idea how to do that), I wonder whether there's a way to see what's happening behind that Splash Screen, or alternatively just get rid of it. Thanks

NsCDE commented 3 years ago

Hi leoctrl

This what you have described is the situation where fvwm waits for some interactive "pick" action. For a quick help, you can break out of this function by pressing Ctrl+Alt+Escape (see fvwm man page for EscapeFunc).

Most probably, this means yout InitFunction in ~/.NsCDE/NsCDE-Init.conf has some chicken-egg condition like for example iconifying just started window is fired up before window appears, and then fvwm without window context wants you to pick some window. This can also be for a move, resize, maximize, move to desk and similar options.

Try to disable your InitFunction in ~/.NsCDE/NsCDE-Init.conf (make it like default temporary) and see if problem dissapears. If it does, put back piece by piece function directives, re-login, and see what is the problem.

Generally, for making operations on windows, you must "Wait [class]|[resource]|[name]" of the window, which is a blocking action, and then proceed when condition of "Wait" appears in existance. "Wait" can also block if window does not appear. Making session startup functions in fvwm is a bit tricky and includes trials and errors.

leoctrl commented 3 years ago

Hi, thanks for your response. I followed your advice and commented out all entries that I had added to 'CommonInitFunction' in $HOME/.NsCDE/NsCDE-Init.conf, which basically are things like 'polkit-gnome-authentication-agent-1' and 'gnome-keyring-daemon', that 'dex' won't autostart due to unmatched DE name. I'm sorry to inform you that that didn't help; besides, none of the entries I had added makes use of Fvwm's 'Wait' function that you pointed out in your response. On the other hand, I noticed a 'Wait gkrellm' in 'InitFunction'; out of frustration I commented that out, including the following 'Schedule 500 All (Gkrellm) Move screen p -0 +0 ewmhiwa' just in case, and that did help. That said, I have no idea what the problem could be with 'gkrellm'; however, in $HOME/.xsession-errors I noticed this message, I hope it'll give you a clue.

[fvwm][GetWindowSizeHints]: <> reason: 2: The hints have been ignored because the window's current size would have become invalid. The new hints will become active when the window generates the next ConfigureRequest.

[fvwm][GetWindowSizeHints]: <> The application window (id 0x4200003) "gkrellm" has broken size hints (inconsistent with current size). fvwm is ignoring those hints. hint override = 0, flags = 230 min_width = 252, min_height = 826, max_width = 252, max_height = 826 width_inc = 0, height_inc = 0 min_aspect = 0/0, max_aspect = 0/0 base_width = 0, base_height = 0 win_gravity = 1

If you are having a problem with the application, send a bug report
with this message included to the application owner.
There is no need to notify fvwm-workers@fvwm.org.

On a side note, I'd like to add that while trying to understand what the problem was I noticed how invocation of 'f_Splash' in '/opt/NsCDE/config/NsCDE-Main.conf' is driven by configuration option 'sandboxmode'; I have therefore taken the liberty of implementing a new configuration option, which I (obviously) called 'nosplash', and add that as a condition for the invocation of 'f_Splash'. This way I managed to disable the start-up slash screen, which I wanted to achieve in order to try and understand what was going on, but on second thoughts I believe is a useful addition. Thanks

leoctrl commented 3 years ago

Update: I concluded that the Fvwm error about gkrellm that I previously reported depends on the theme I was using; as a matter of fact, I wasn't using $HOME/.gkrellm2/themes/NsCDE, but one of the gkrellm themes available at http://www.muhri.net/ I have tried several gkrellm themes (NsCSDE and others) and seen that some some seem to be compatible with Fvwm (i.e. no Fvwm complains in $HOME/.xsession-errors) while others aren't (same complaints). However, choosing a gkrellm Fvwm-compliant theme doesn't resolve my initial problem: NsCDE's splash screen still doesn't go away by itself and needs to be kicked, but having found a way to disable it I'm happy with that and I think I'll settle on that workaround. Thanks

NsCDE commented 3 years ago

Hi @leoctrl

One thing is not clear to me: was commenting out 3 lines about calling and moving gkrellm in NsCDE-Init.conf helped not to block splash screen on log in or not? Also, does Ctrl+Alt+Escape helps when presed once or twice or not?

Second, nosplash as option is interesting and I may add it for 1.3.

Third, I'm aware of this clash of gkrellm and fvwm. Thanks for the new info that issue is theme dependent. This should be investigated, I was not aware of this fact. However, be sure this is nothing to do with your initial problem with splash screen. It is just a warning and everything should proceed smoothly.

If you have a time, can you try to call f_Splash manually once session is already active?

FvwmCommand f_Splash

... and see does it blocks or finishes and exits after 6-8 seconds.

I have put great care and internal timeouts in f_Splash and Splash scriptlet not to block forever, but it seems something is on a way of it still.

leoctrl commented 3 years ago

I agree, I probably didn't make myself very clear, so I'll recap.

First of all, I'd like to point out that the Splash Screen freeze problem occurs only on first login after reboot or power on.

Test #1 Configuration: Splash Screen enabled gkrellm statements in $HOME/.NsCDE/NsCDE-Init.conf uncommented Results: After approx. 10 seconds the Splash Screen appears After approx. 8 more seconds the Splash Screen freezes with mouse pointer turned to crosshairs Ctrl+C -> does nothing Click on Splash Screen text -> Splash Screen goes away but mouse pointer is still crosshairs, Esc restores normal pointer Ctrl+Alt+Esc -> does nothing Ctrl+Alt+Esc again -> Splash Screen goes away and mouse pointer is restored to normal

Test #2 Configuration: Splash Screen enabled Following 2 statements in $HOME/.NsCDE/NsCDE-Init.conf commented out

Test #3 Configuration: Splash Screen disabled gkrellm statements in $HOME/.NsCDE/NsCDE-Init.conf uncommented Results: After approx. 10 seconds the NsCDE desktop appears complete, except for the gkrellm window, and the mouse pointer is busy After approx. 10 more seconds the gkrellm window appears and mouse pointer returns normal

Test #4 Manual f_Splash invocation Results: Splash Screen goes away by itself after approx. 8 seconds.

As I said, I'm quite happy with the disabled Splash Screen; I've attached my 'nosplash' patch, just to give you an idea of what I did. Thanks

add_nosplash_configuration_option.patch.txt

NsCDE commented 3 years ago

Hi @leoctrl

Thanks for the detailed tests

First of all, 10 seconds BEFORE splash screen appears is far too long. Splash screen should appear almost immediately on startup. It is possible to see below splash maybe for a 0.2 up to 1-2 seconds, but in your setup something is really troubling FVWM on startup.

The fact that you have to press Ctrl+Alt+Esc twice tells me that there are at least two things blocking normal setup, because one Ctrl+Alt+Esc breaks once, FVWM proceeds for one or more instuctions, and then blocks again and second Ctrl+Alt+Escape breaks this blockage too.

Try with the empty InitFunction in the NsCDE-Init.conf: comment it out complitely and try to re-login. If it doesn't helps, then I can conclude from what you described above that something before Front Panel appears and blocks your startup. See if you have a custom FontPanel.actions in ~/.NsCDE and try without it.

You can always try to set up new user, log in as that user, make new NsCDE setup and see if problem occurs on "vanilla" profile. If it does, then something with your system setup of NsCDE is not ok.

NsCDE startup should not last more then 8-10 seconds alltogether with Splash.

P. S. I will accept your idea for disablement of the Splash screen so people who do not want it can disable it, but this is not solution of your particular (this) problem.

leoctrl commented 3 years ago

OK, I finally found what makes my Splash Screen freeze: some time ago I had noticed this section in $HOME/.NsCDE/NsCDE-Functions.local

"# Hook of the f_SysAddWindowEvent called from" "# FvwmEvent on add_window event. Called when new" "# window appears. This example focuses every new" "# window but avoids FrontPanel and Subpanels" "# because of strange interaction" "# DestroyFunc f_AddWindowEvent" "# AddToFunc f_AddWindowEvent" "# + I Current (NsCDE-Subpanel-*) Break 1" "# + I Current (FrontPanel) Break 1" "# + I Echo $0" "# + I WindowId $0 Focus"

Since automatic focus to new windows is what I like, I had uncommented that section; commenting it out again, I no longer experience the freeze.

Some additional notes:

Thanks a lot for your support

NsCDE commented 3 years ago

Hi @leoctrl

I must carefully comment or reorganize this f_AddWindowEvent example. Now I see it is harming during startup.

leoctrl commented 3 years ago

You're right! GrabFocus is the solution: it implements the behaviour I like and at the same time does not freeze the Splash Screen. (and I've also learnt a few more things about NsCDE and Fvwm) Thanks!