Re: _OB_APP_* not populated
Jakub Piskorz <jakub.piskorz-UNxBk3u0Mol8UrSeD/[email protected]> Tue, 17 Jul 2018 17:56:22 +0200
| Newsgroups | gmane.comp.window-managers.openbox |
|---|---|
| Message-ID | <CACB-MajCJprWS8NK+WOHtnwMa5ifz8bpBT5M-2vND1rL25oQyQ@mail.gmail.com> |
--===============5039792468528920483== Content-Type: multipart/alternative; boundary="000000000000e9a159057133fc31" --000000000000e9a159057133fc31 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm narrowing down the issue. I discovered that correct WM_CLASS is available in openbox/client.c - client_get_session_ids function. But got =3D OBT_PROP_GETSS_TYPE(self->window, WM_CLASS, STRING_NO_CC, &ss); returns true with string array filled with NULLs. Going deeper, I've found that g_convert function is failing silently. After adding GError I've got the message: Conversion from character set iso-8859-1 to utf-8 is not supported= . Now, my buildroot is quite bare. I didn't bother to check gconv libs copy and it was it. After adding missing gconv libraries, my _OB_APP_NAME(UTF8_STRING) was populated correctly. For Openbox it would be nice to log some warning that conversion failed, now it is just silently ignored. If someone else is having a similar issue, add this to your buildroot config: BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY=3Dy BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST=3D"ISO8859-1 UNICODE" BR2_GENERATE_LOCALE=3D"C, C.ISO-8859-1, en_US, en_US.ISO-8859-1" Yours sincerely, Jakub Piskorz Software Engineer Thaumatec Sp. z o.o. ul. Mickiewicza 20C, 51-619, Wroc=C5=82aw Poland Phone: +48-882-053-705jakub.piskorz-UNxBk3u0MolwHa1wAW5dJjIf2SR65u4aSbDX895tXHM@public.gmane.org 2018-07-11 11:31 GMT+02:00 Jakub Piskorz <jakub.piskorz-UNxBk3u0Mol8UrSeD/[email protected]>: > Hello, > > I'm trying to run openbox on a custom buildroot based system. Window > manager seems to start fine, I can launch apps like xterm or custom > xcb apps. And I can change rc.xml to modify appearance (like contents of > the title bar). > > But I'm not able to customize application look because filters are not > matched. When I'm checking obxprop, the _OB_APP_* variables are not > populated: > > # DISPLAY=3D:0 obxprop --id 8388621 > WM_STATE(WM_STATE) =3D 1, 0 > _NET_WM_DESKTOP(CARDINAL) =3D 0 > _NET_WM_ALLOWED_ACTIONS(ATOM) =3D _NET_WM_ACTION_CHANGE_DESKTOP, > _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_MOVE, > _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCREEN= , > _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, > _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW, _OB_WM_ACTION_UNDECORATE > _KDE_NET_WM_FRAME_STRUT(CARDINAL) =3D 1, 1, 18, 5 > _NET_FRAME_EXTENTS(CARDINAL) =3D 1, 1, 18, 5 > _NET_WM_STATE(ATOM) =3D > _OB_APP_TYPE(UTF8_STRING) =3D "normal" > _OB_APP_TITLE(UTF8_STRING) =3D "Unnamed Window" > _OB_APP_GROUP_CLASS(UTF8_STRING) =3D > _OB_APP_GROUP_NAME(UTF8_STRING) =3D > _OB_APP_CLASS(UTF8_STRING) =3D > _OB_APP_NAME(UTF8_STRING) =3D > _OB_APP_ROLE(UTF8_STRING) =3D > _NET_WM_VISIBLE_ICON_NAME(UTF8_STRING) =3D "Unnamed Window" > _NET_WM_VISIBLE_NAME(UTF8_STRING) =3D "Unnamed Window" > WM_PROTOCOLS(ATOM) =3D WM_DELETE_WINDOW > _NET_WM_PID(CARDINAL) =3D 2524 > WM_CLIENT_LEADER(WINDOW) =3D 8388621 > WM_LOCALE_NAME(STRING) =3D "C" > WM_CLASS(STRING) =3D "xterm", "XTerm" > WM_HINTS(WM_HINTS) =3D 39, 1, 1, 8388626, 0, 0, 0, 8388628, 0 > WM_NORMAL_HINTS(WM_SIZE_HINTS) =3D 856, 0, 0, 484, 316, 10, 17, 0, 0, 6, = 13, > 0, 0, 0, 0, 4, 4, 1 > WM_CLIENT_MACHINE(STRING) =3D "nuc" > WM_COMMAND(STRING) =3D "xterm" > WM_ICON_NAME(STRING) =3D "xterm" > WM_NAME(STRING) =3D "xterm" > > (I do not have mouse there, so I need to run obxprop with --id param). > > Googling that issue yields literally no results, all options are for > filtering rc.xml based on valid _OB_APP_NAME... > > I have no idea what is going on so I'll attach all info which may be > relevant: > > I'm starting openbox directly from xinitrc, which is triggered by > startx command launched by systemd. > > Here is my startx unit file: > > # cat /etc/systemd/system/multi-user.target.wants/x.service > [Unit] > After=3Dsystemd-user-sessions.service > > [Service] > ExecStart=3D/bin/startx -- -nolisten tcp -s off -dpms -nocursor vt1 > > [Install] > WantedBy=3Dmulti-user.target > > System has only root account. Xterm is started through > /etc/xdg/openbox/autostart. > > Here is xinitrc: > > # cat /etc/X11/xinit/xinitrc > #!/bin/sh > > userresources=3D$HOME/.Xresources > usermodmap=3D$HOME/.Xmodmap > sysresources=3D/etc/X11/xinit/.Xresources > sysmodmap=3D/etc/X11/xinit/.Xmodmap > > # merge in defaults and keymaps > > if [ -f $sysresources ]; then > xrdb -merge $sysresources > fi > > if [ -f $sysmodmap ]; then > xmodmap $sysmodmap > fi > > if [ -f "$userresources" ]; then > xrdb -merge "$userresources" > fi > > if [ -f "$usermodmap" ]; then > xmodmap "$usermodmap" > fi > > # start some nice programs > > if [ -d /etc/X11/xinit/xinitrc.d ] ; then > for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do > [ -x "$f" ] && . "$f" > done > unset f > fi > > feh --no-fehbg --image-bg black --bg-center /usr/share/ui/logo.png & > exec openbox-session > > Please, I'm pulling my hair off with this, any help will be appreciated. > --000000000000e9a159057133fc31 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">I'm narrowing down the issue.<div><br></div><div>I dis= covered that correct WM_CLASS is available in openbox/client.c -=C2=A0clien= t_get_session_ids function. But=C2=A0got =3D OBT_PROP_GETSS_TYPE(self->w= indow, WM_CLASS, STRING_NO_CC, &ss); returns true with string array fil= led with NULLs. Going deeper, I've found that g_convert function is fai= ling silently. After adding GError I've got the message: Conversion fro= m character set iso-8859-1 to utf-8 is not supported.</div><div><br></div><= div>Now, my buildroot=C2=A0is quite bare. I didn't bother to check gcon= v libs copy and it was it. After adding missing gconv libraries, my=C2=A0<s= pan style=3D"font-size:12.8px;background-color:rgb(255,255,255);text-decora= tion-style:initial;text-decoration-color:initial;float:none;display:inline"= >_OB_APP_NAME(UTF8_STRING) was populated correctly.<br><br>For Openbox it w= ould be nice to log some warning that conversion failed, now it is just sil= ently ignored.<br><br>If someone else is having a similar issue, add this t= o your buildroot config:</span></div><div><span style=3D"font-size:12.8px;b= ackground-color:rgb(255,255,255);text-decoration-style:initial;text-decorat= ion-color:initial;float:none;display:inline"><br></span></div><div><span st= yle=3D"background-color:rgb(255,255,255);text-decoration-style:initial;text= -decoration-color:initial;float:none;display:inline"><div><span style=3D"fo= nt-size:12.8px">BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY=3Dy</span></div><div><s= pan style=3D"font-size:12.8px">BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST=3D"= ISO8859-1 UNICODE"</span></div><div style=3D"font-size:12.8px"><div st= yle=3D"font-size:12.8px">BR2_GENERATE_LOCALE=3D"C, C.ISO-8859-1, en_US= , en_US.ISO-8859-1"</div></div></span></div></div><div class=3D"gmail_= extra"><br clear=3D"all"><div><div class=3D"gmail_signature" data-smartmail= =3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><pre style=3D"w= hite-space:pre-wrap;color:rgb(136,136,136)">Yours sincerely, Jakub Piskorz Software Engineer Thaumatec Sp. z o.o. ul. Mickiewicza 20C, 51-619, Wroc=C5=82aw Poland Phone: +48-882-053-705 <a href=3D"mailto:jakub.piskorz-UNxBk3u0Mol8UrSeD/[email protected]" style=3D"color:rgb(17,85,204= )" target=3D"_blank">jakub.piskorz-UNxBk3u0Mol8UrSeD/[email protected]</a> <a href=3D"http://www.thaumatec.com/" style=3D"color:rgb(17,85,204)" target= =3D"_blank">www.thaumatec.com</a></pre></div></div></div></div></div> <br><div class=3D"gmail_quote">2018-07-11 11:31 GMT+02:00 Jakub Piskorz <sp= an dir=3D"ltr"><<a href=3D"mailto:jakub.piskorz-UNxBk3u0Mol8UrSeD/[email protected]" target=3D= "_blank">jakub.piskorz-UNxBk3u0Mol8UrSeD/[email protected]</a>></span>:<br><blockquote class= =3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd= ing-left:1ex"><div dir=3D"ltr">Hello,<div><br></div><div>I'm trying to = run openbox on a custom buildroot=C2=A0based system. Window manager seems t= o start fine, I can launch apps like xterm or custom xcb=C2=A0apps. And I c= an change rc.xml to modify appearance (like contents of the title bar).</di= v><div><br></div><div>But I'm not able to customize application look be= cause filters are not matched. When I'm checking obxprop, the _OB_APP_*= variables are not populated:<br><br><div># DISPLAY=3D:0 obxprop --id 83886= 21=C2=A0</div><div>WM_STATE(WM_STATE) =3D 1, 0</div><div>_NET_WM_DESKTOP(CA= RDINAL) =3D 0</div><div>_NET_WM_ALLOWED_ACTIONS(ATOM) =3D _NET_WM_ACTION_CH= ANGE_DESKTOP, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_MO= VE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCRE= EN, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACT= ION_ABOVE, _NET_WM_ACTION_BELOW, _OB_WM_ACTION_UNDECORATE</div><div>_KDE_NE= T_WM_FRAME_STRUT(<wbr>CARDINAL) =3D 1, 1, 18, 5</div><div>_NET_FRAME_EXTENT= S(CARDINAL) =3D 1, 1, 18, 5</div><div>_NET_WM_STATE(ATOM) =3D=C2=A0</div><d= iv>_OB_APP_TYPE(UTF8_STRING) =3D "normal"</div><div>_OB_APP_TITLE= (UTF8_STRING) =3D "Unnamed Window"</div><div>_OB_APP_GROUP_CLASS(= UTF8_<wbr>STRING) =3D=C2=A0</div><div>_OB_APP_GROUP_NAME(UTF8_<wbr>STRING) = =3D=C2=A0</div><div>_OB_APP_CLASS(UTF8_STRING) =3D=C2=A0</div><div>_OB_APP_= NAME(UTF8_STRING) =3D=C2=A0</div><div>_OB_APP_ROLE(UTF8_STRING) =3D=C2=A0</= div><div>_NET_WM_VISIBLE_ICON_NAME(<wbr>UTF8_STRING) =3D "Unnamed Wind= ow"</div><div>_NET_WM_VISIBLE_NAME(UTF8_<wbr>STRING) =3D "Unnamed= Window"</div><div>WM_PROTOCOLS(ATOM) =3D WM_DELETE_WINDOW</div><div>_= NET_WM_PID(CARDINAL) =3D 2524</div><div>WM_CLIENT_LEADER(WINDOW) =3D 838862= 1</div><div>WM_LOCALE_NAME(STRING) =3D "C"</div><div>WM_CLASS(STR= ING) =3D "xterm", "XTerm"</div><div>WM_HINTS(WM_HINTS) = =3D 39, 1, 1, 8388626, 0, 0, 0, 8388628, 0</div><div>WM_NORMAL_HINTS(WM_SIZ= E_HINTS) =3D 856, 0, 0, 484, 316, 10, 17, 0, 0, 6, 13, 0, 0, 0, 0, 4, 4, 1<= /div><div>WM_CLIENT_MACHINE(STRING) =3D "nuc"</div><div>WM_COMMAN= D(STRING) =3D "xterm"</div><div>WM_ICON_NAME(STRING) =3D "xt= erm"</div><div>WM_NAME(STRING) =3D "xterm"</div><div><br></d= iv><div>(I do not have mouse there, so I need to run obxprop=C2=A0with --id= param).</div><div><br></div><div>Googling that issue yields=C2=A0literally= no results, all options are for filtering rc.xml based on valid _OB_APP_NA= ME...</div><div><br></div><div>I have no idea what is going on so I'll = attach all info which may be relevant:</div><br>I'm starting openbox=C2= =A0directly from xinitrc, which is triggered by startx=C2=A0command launche= d by systemd.<br><br>Here is my startx=C2=A0unit file:</div><div><br></div>= <div><div># cat /etc/systemd/system/multi-<wbr>user.target.wants/x.service= =C2=A0</div><div>[Unit]</div><div>After=3Dsystemd-user-sessions.<wbr>servic= e</div><div><br></div><div>[Service]</div><div>ExecStart=3D/bin/startx -- -= nolisten tcp -s off -dpms -nocursor vt1</div><div><br></div><div>[Install]<= /div><div>WantedBy=3Dmulti-user.target</div></div><div><br></div><div>Syste= m has only root account. Xterm is started through /etc/xdg/openbox/autostar= t.<br><br>Here is xinitrc:</div><div><br></div><div><div># cat /etc/X11/xin= it/xinitrc</div><div>#!/bin/sh</div><div><br></div><div>userresources=3D$HO= ME/.<wbr>Xresources</div><div>usermodmap=3D$HOME/.Xmodmap</div><div>sysreso= urces=3D/etc/X11/xinit/.<wbr>Xresources</div><div>sysmodmap=3D/etc/X11/xini= t/.<wbr>Xmodmap</div><div><br></div><div># merge in defaults and keymaps</d= iv><div><br></div><div>if [ -f $sysresources ]; then</div><div>=C2=A0 =C2= =A0 xrdb -merge $sysresources<br></div><div>fi</div><div><br></div><div>if = [ -f $sysmodmap ]; then</div><div>=C2=A0 =C2=A0 xmodmap $sysmodmap</div><di= v>fi</div><div><br></div><div>if [ -f "$userresources" ]; then</d= iv><div>=C2=A0 =C2=A0 xrdb -merge "$userresources"</div><div>fi</= div><div><br></div><div>if [ -f "$usermodmap" ]; then</div><div>= =C2=A0 =C2=A0 xmodmap "$usermodmap"</div><div>fi</div><div><br></= div><div># start some nice programs</div><div><br></div><div>if [ -d /etc/X= 11/xinit/xinitrc.d ] ; then</div><div>=C2=A0for f in /etc/X11/xinit/xinitrc= .d/?*.sh ; do</div><div>=C2=A0 [ -x "$f" ] && . "$f&= quot;</div><div>=C2=A0done</div><div>=C2=A0unset f</div><div>fi</div><div><= br></div><div>feh --no-fehbg --image-bg black --bg-center /usr/share/ui/log= o.png &</div><div>exec openbox-session</div></div><div><br></div><div>P= lease, I'm pulling my hair off with this, any help will be appreciated.= </div></div> </blockquote></div><br></div> --000000000000e9a159057133fc31-- --===============5039792468528920483== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kb3BlbmJveCBt YWlsaW5nIGxpc3QKb3BlbmJveEBpY2N1bHVzLm9yZwpodHRwOi8vaWNjdWx1cy5vcmcvbWFpbG1h bi9saXN0aW5mby9vcGVuYm94 --===============5039792468528920483==--