Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:GA
xosview
xosview-1.14-pixmap.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xosview-1.14-pixmap.patch of Package xosview
From 9bb78e2c1ad6bcf9c20ca81209d5000d2b993193 Mon Sep 17 00:00:00 2001 From: Werner Fink <werner@suse.de> Date: Mon, 29 Apr 2013 14:09:22 +0200 Subject: [PATCH] Re-enable backgroung pixmap xpm ... as expected by some experienced users Signed-off-by: Werner Fink <werner@suse.de> --- Makefile | 4 ++++ xwin.cc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git Makefile Makefile index ea6af9a..aace753 100644 --- Makefile +++ Makefile @@ -59,6 +59,8 @@ CPPFLAGS += -Ilinux/ ifneq ($(USE_SYSCALLS),0) CPPFLAGS += -DUSE_SYSCALLS endif +LDLIBS += -lXpm +xwin.o: CPPFLAGS += -DHAVE_XPM endif ifeq ($(PLATFORM), bsd) @@ -77,6 +79,8 @@ OBJS += bsd/MeterMaker.o \ bsd/coretemp.o \ bsd/sensor.o CPPFLAGS += -Ibsd/ +LDLIBS += -lXpm +xwin.o: CPPFLAGS += -DHAVE_XPM endif ifeq ($(PLATFORM), irix65) diff --git xwin.cc xwin.cc index da67729..3b492b0 100644 --- xwin.cc +++ xwin.cc @@ -1,4 +1,7 @@ #include <X11/Xatom.h> +#ifdef HAVE_XPM +# include <X11/xpm.h> +#endif #include <stdlib.h> #include <stdio.h> #include <unistd.h> @@ -107,6 +110,14 @@ void XWin::init( int argc, char **argv ){ XChangeWindowAttributes(display_, window_, (CWColormap | CWBitGravity), &xswa); +#ifdef HAVE_XPM + Pixmap background_pixmap; + + // If there is a pixmap file, set it as the background + if (getPixmap(&background_pixmap)) + XSetWindowBackgroundPixmap(display_,window_,background_pixmap); +#endif + // add the events Event *tmp = events_; while ( tmp != NULL ){ @@ -217,6 +228,40 @@ void XWin::setColors( void ){ } //----------------------------------------------------------------------------- +int XWin::getPixmap(Pixmap *pixmap) +{ +#ifdef HAVE_XPM + char *pixmap_file; + XWindowAttributes root_att; + XpmAttributes pixmap_att; + + pixmap_file = (char*) getResourceOrUseDefault("pixmapName",NULL); + + if (!pixmap_file) + return 0; + + XGetWindowAttributes(display_, DefaultRootWindow(display_),&root_att); + pixmap_att.closeness=30000; + pixmap_att.colormap=root_att.colormap; + pixmap_att.valuemask=XpmSize|XpmReturnPixels|XpmColormap|XpmCloseness; + + if (XpmReadFileToPixmap(display_,DefaultRootWindow(display_),pixmap_file, + pixmap, NULL, &pixmap_att)) + { + std::cerr << "Pixmap " << pixmap_file << " not found" << std::endl; + std::cerr << "Defaulting to blank" << std::endl; + pixmap = NULL; + return 0; + } + + return 1; +#else + pixmap = NULL; + return 0; +#endif +} + +//----------------------------------------------------------------------------- void XWin::getGeometry( void ){ char default_geometry[80]; int bitmask; -- 1.7.9.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor