-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
widgets/magick: add feature to read root window pixmap
First of all: holy shit what a lesson in frustration this has been. Thanks for nothing XCB devs, the practically nonexistent docs for working with X pixmaps made this a lot harder than it should have been. This feature enables reading the root pixmap and applying effects directly onto the resulting bitmap so you won't have to supply an image config option to the magick background widget if you set the background on the X root window (feh and other apps do this). Some WMs don't, in those cases you'll still have to specify your background image for this widget to work. The feature works by reading the root window background pixmap, then converting it to a valid BMP file in-memory. GraphicsMagick reads this BMP file and applies effects to the image. Possible stuff that might become issues in the future, and areas that have room for improvement: * system endianness *may* be an issue as we're working directly on RGB integer values stored in memory, so the R and B channels may become swapped on big-endian systems * if X replies with a pixmap that isn't 24-bit the whole thing will probably crash, some error handling should be added for some edge-case scenarios Ref #49
- Loading branch information
Showing
2 changed files
with
160 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters