Batch connect xfce minimized windows disappear

I have an xfce VNC batch connect job, and when I click the minimize button on the top right of the window, I get a black screen with no buttons whatsoever. It doesn’t pick up my alt+tab and there’s no taskbar. How can I avoid this? Can I get a taskbar?

script.sh.erb:

#!/usr/bin/env bash

# Clean the environment
module purge

module load mathematica

# Set working directory to home directory
cd "${HOME}"

#
# Launch Xfce Window Manager and Panel
#
(
  export SEND_256_COLORS_TO_REMOTE=1
  export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"
  export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"
  export XDG_CACHE_HOME="$(mktemp -d)"
  module restore
  set -x
  xfwm4 --compositor=off --daemon --sm-client-disable
  xsetroot -solid "#D3D3D3"
  xfsettingsd --sm-client-disable
  xfce4-panel --sm-client-disable
) &

# Launch Mathematica
<%- if context.gpus.to_i > 0 -%>
    module list
    set -x
    vglrun mathematica
<%- else -%>
    module list
    set -x
    mathematica
<%- end -%>

I’ve found that there is a way to send the alt+tab keystrokes through noVNC, but I’d rather not explain that to my users.

Is this in the Mathematica app that you’re clicking the button? I don’t have that app myself so I’m not sure what things look like that you are interacting with.

For the alt+tab I’m not sure what you mean here, sorry. Are you trying to cycle through windows within mathematica itself? Or is the key combo not picked up at all at the browser in VNC?

It’s a generic xfce window, I think.

After the window disappears and I’m left with a black screen, alt+tab can make the window come back.

I’m not sure how to get a taskbar to keep that window if it gets minimized. Looking at some things now to see if that’s possible. I can see how that would be frustrating for the user to click and not see anything to then bring the window back.

Another option may be to run this in a desktop and have mathematica accessed from within there so you can have xfce handle the window management.

I’ll have to take more of a look at this, sorry I don’t have a better solution at the moment. Maybe someone else has had this issue and can chime in though.

Would you be able to also include the submit.yml.erb you are using with this as well?

batch_connect:
  template: "vnc"

<%-
extra_slurm_args_array = if extra_slurm_args.blank?
        []
    else
        extra_slurm_args.split(' ')
    end
-%>

script:
  native:
  - --partition=<%= _partition.blank? ? "cpu-preempt" : _partition.to_s %>
  - --cpus-per-task=<%= cpus_per_task.blank? ? 2 : cpus_per_task.to_i %>
  - --time=<%= duration_hours.blank? ? "1:00:00" : duration_hours %>
  - --nodes=1
  - --mem=<%= mem_gigs.blank? ? 8 : mem_gigs.to_i %>GB
  - --gpus=<%= gpus.blank? ? 0 : gpus %>
  - --constraint=x86_64|x86_64_v2|x86_64_v3|x86_64_v4
  <%- extra_slurm_args_array.each do |arg| -%>
  - <%= arg %>
  <%- end -%>

form.yml (1.8 KB)
Here’s my form.yml.erb as well

This batch connect app is just a copy of Matlab. On other deployments (with xfce) does Matlab also have a black screen in the background with no buttons?

Hi Simon.

Have you tried running mathematica in any other windows manager? Just curious to know if you see similar behavior.

Thanks,
-gerald

This appears to be an issue with how the XFCE panel is configured. I found this comment regarding the same.


The first time you log in to a newly created user id, a pop-up asks you whether you want "the default panel OR one blank panel."

If you pick the former, the Windows Button applet is already included for you in the default panel, so you need do nothing -- your minimization and retrieval of windows or panels will work just fine.

If you pick the latter, just as Richyrich says, you must manually add the Windows Button applet. If you don't, as soon as you try to minimize an application it disappears.

My problem was that I picked the "one blank panel" option and didn't know I needed to add the Windows Button applet for windows to minimize/maximum properly.

Thank you Richyrich for your help.

I’m trying to find if there an entry in the XFCE config file that will fix this. So far no luck. Everyone is stating you have to do it through the properties. Here’s a link to that discussion.

https://forum.xfce.org/viewtopic.php?id=9928

This is what I have found thus far. If I find anything more, I will post it.

Thanks,
-gerald

Here’s something that might help.

A coworker of mine found the solution:

The issue was that xfwm4 no longer respects --daemon , so xfce4-panel wasn’t being run, which is where the minimized windows go (among other things).

So we just remove --daemon:

xfwm4 --compositor=off --sm-client-disable &

That’s awesome. Thanks for posting the solution. I am very sure it will help many others.

-gerald