Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

XEmbed error when attaching to transparency-pathced tabbed #342

Open
githaff opened this issue Jan 28, 2019 · 6 comments
Open

XEmbed error when attaching to transparency-pathced tabbed #342

githaff opened this issue Jan 28, 2019 · 6 comments

Comments

@githaff
Copy link

githaff commented Jan 28, 2019

Getting an error while trying to attach sxiv instance via xembed to a suckless tabbed utility patched with the transparency patch (alpha.diff from 28 Feb 2017 available at https://tools.suckless.org/tabbed/patches/alpha/).

Error text:

$ /usr/bin/sxiv -e 0x2800002 ~/Screenshot.png
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 1 (X_CreateWindow)
Serial number of failed request: 26
Current serial number in output stream: 37

It happens at the 216 line in window.c:

cursors[i].icon = XCreateFontCursor(e->dpy, cursors[i].name);

With non-patched tabbed instance everything is ok.
At the same time urxvt, surf and zathura do not have any issues with the patched version.

Is there any additional info I can provide to help with this? Or is it an issue with this tabbed patch? If so, would really appreciate any pointers on how I can make a workaround for it.

@githaff
Copy link
Author

githaff commented Feb 3, 2019

Have implemented a workaround for now: https://github.com/githaff/sxiv/tree/embed-on-transp
Two things that make this workaround a bad hack:

  1. it makes sxiv work in the transparent tabbed client, but breaks for the non-transparent version. Couldn't find a way to distinguish between these two from the sxiv side, so for now used an envinronment variable for it (DIEM_TABBED_TRANS should be declared to work with transparent version).
  2. even when the hack works and sxiv gets embedded, the image gets corrupted with alpha layer. Artifacts disappear when both alpha and antialias are disabled. So I force them off when running in a transparent scenario.

Would be grateful if you have any ideas what I can do to make this hack less of a hack. I don't have a lot of experience with X imlib.

@githaff
Copy link
Author

githaff commented Feb 3, 2019

And yes, I have no idea why I have so focused on the tabbed application :D
The same issue is present with just a plain urxvt with true transparency enabled. That is urxvt with

urxvt.depth: 32

in the xresources.

@xyb3rt
Copy link
Owner

xyb3rt commented Feb 10, 2019

Sorry, I currently do not have the time to look into this. Please note, that I've never used the XEmbed functionality and now hate myself for merging it because I now do own the code and feel the need to fix it...

@githaff
Copy link
Author

githaff commented Feb 18, 2019

Sure, I understand. Would also look into it a bit deeper myself, but also don't have time at the moment (and the nearest foreseeable future).
But if it makes you fill better, the xembed functionality is the main sxiv killer feature for me and the reason I am using it :) It's very convenient to run image viewer in the same place as the terminal. Especially in tiling WMs, not to open another window further dividing the screen is a good thing.

@astier
Copy link

astier commented Mar 1, 2019

@githaff I didn't bother to replicate your error but I if you use dwm then I would recommend the swallow patch. I use dwm with the swallow patch and the st terminal (both with alpha patches) and I never had issues (neither with sxiv or other applications). Didn't try it with tabbed tho.

@jaredforrest
Copy link

I don't know if you're still interested in this @githaff but I've made a workaround which doesn't seem to have any issues..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants