Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ xf86-qubes-common/libxf86-qubes-common.so
/pipewire/pw-module-run
*.dep
/gui-agent/qubes-gui
/gui-agent/qubes-gui-runuser
/gui-common/qubes-gui-runuser
2 changes: 2 additions & 0 deletions archlinux/PKGBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ makedepends=(
libxcomposite
libxt
libxdamage
libunistring
pixman
lsb-release
'qubes-vm-gui-common>=4.3.0'
Expand Down Expand Up @@ -57,6 +58,7 @@ package_qubes-vm-gui() {
'zenity'
'qubes-libvchan'
'python-xcffib'
'libunistring'
# Xorg dependencies are on specific ABI versions: https://www.x.org/wiki/XorgModuleABIVersions/
# These can also be verified with pacman -Qi xorg-server (Provides)
# There is however a discrepancy if verifying via pkg-config --variable abi_videodrv xorg-server
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Build-Depends:
qubes-gui-common (>= 4.3.0),
qubesdb-dev,
libltdl-dev,
libunistring-dev,
Standards-Version: 4.4.0.1
Homepage: http://www.qubes-os.org/
#Vcs-Git: git://git.debian.org/collab-maint/qubes-gui-agent.git
Expand Down
3 changes: 2 additions & 1 deletion gui-agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ CFLAGS += -I../include/ `pkg-config --cflags vchan` -g -Wall -Wextra -Werror -fP
-Wmissing-prototypes -Wstrict-prototypes -Wold-style-declaration \
-Wold-style-definition
OBJS = vmside.o txrx-vchan.o error.o list.o encoding.o
LIBS = -lX11 -lXdamage -lXcomposite -lXfixes `pkg-config --libs vchan` -lqubesdb
LIBS = -lX11 -lXdamage -lXcomposite -lXfixes `pkg-config --libs vchan` -lqubesdb \
-lunistring


all: qubes-gui qubes-gui-runuser
Expand Down
22 changes: 22 additions & 0 deletions gui-agent/vmside.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "encoding.h"
#include <libvchan.h>
#include <poll.h>
#include "unistr.h"


#include <linux/input.h>
Expand Down Expand Up @@ -651,6 +652,27 @@ void send_wmname(Ghandles * g, XID window)
if (!get_net_wmname(g, window, msg.data, sizeof(msg.data)))
if (!getwmname_tochar(g, window, msg.data, sizeof(msg.data)))
return;
if (strlen(msg.data) == sizeof(msg.data) - 1) {
// Window title might had been longer than output buffer.
// Trim at correct utf8 boundary and set end to U+2026 (Horizontal Ellipsis)
msg.data[sizeof(msg.data) - 4] = 0;
for (int i=0; i < 4; i++) {
uint8_t * last_byte = (uint8_t *)msg.data + sizeof(msg.data) - 5 - i;
// check for valid 1, 2, 3 or 4 byte uft8 char at the end of string
if (
!u8_check(last_byte, 1) ||
!u8_check(last_byte - 1, 2) ||
!u8_check(last_byte - 2, 3) ||
!u8_check(last_byte - 3, 4)
) {
break;
} else {
// trim one invalid byte at end of string
*last_byte = 0;
}
}
strncat(msg.data, "\xE2\x80\xA6", sizeof(msg.data) - 1);
}
hdr.window = window;
hdr.type = MSG_WMNAME;
write_message(g->vchan, hdr, msg);
Expand Down
2 changes: 2 additions & 0 deletions rpm_spec/gui-agent.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ BuildRequires: qubes-gui-common-devel >= 4.3.0
BuildRequires: qubes-db-devel
BuildRequires: xen-devel
BuildRequires: systemd-rpm-macros
BuildRequires: libunistring-devel
%if 0%{?is_opensuse}
# for directory ownership
BuildRequires: xinit
Expand Down Expand Up @@ -102,6 +103,7 @@ Requires: xev
Requires: xdpyinfo
Requires: xprop
Requires: xrandr
Requires: libunistring

Provides: qubes-gui-vm = %{version}-%{release}
Obsoletes: qubes-gui-vm < 4.0.0
Expand Down