Skip to content

Commit

Permalink
Merge pull request #334 from DSD-DBS/xpra-focus-fix
Browse files Browse the repository at this point in the history
fix: Fix an issue where modals could be unfocused causing soft-locks
  • Loading branch information
MoritzWeber0 authored Nov 1, 2024
2 parents 3ed304f + 5786a8f commit 6d0eebd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions remote/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ RUN wget -qO /usr/share/keyrings/xpra.asc ${XPRA_REGISTRY}/xpra.asc && \
nginx && \
rm -rf /var/lib/apt/lists/*

# Inject script to force focus on modal windows in xpra client
# and remove the compressed index.html files because they don't contain our fix
RUN sed -i '/load_default_settings();/a \
setInterval(() => {\
for (const [id, win] of Object.entries(client.id_to_window).toReversed()) {\
if (win.metadata.modal) {\
if (client.topwindow !== parseInt(id)) {\
console.log("Forcing focus on modal window", id);\
client.set_focus(win);\
break;\
}\
}\
}\
}, 100);' /usr/share/xpra/www/index.html \
&& rm /usr/share/xpra/www/index.html.gz \
&& rm /usr/share/xpra/www/index.html.br
COPY rc.xml /etc/xdg/openbox/rc.xml
COPY menu.xml /etc/xdg/openbox/menu.xml

Expand Down

0 comments on commit 6d0eebd

Please sign in to comment.