diff options
Diffstat (limited to 'xine_sxfe_frontend.c')
-rw-r--r-- | xine_sxfe_frontend.c | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index e576a903..0dc427aa 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.41 2008-04-10 15:01:31 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.41.2.2 2008-09-26 13:08:22 phintuka Exp $ * */ @@ -204,8 +204,6 @@ typedef struct sxfe_s { /* Common (non-X11/FB) frontend functions */ #include "xine_frontend.c" -#include "vdrlogo_32x32.c" - #define DOUBLECLICK_TIME 500 // ms #define OSD_DEF_WIDTH 720 @@ -792,6 +790,31 @@ static void hud_osd_close(frontend_t *this_gen) #endif /* HAVE_XRENDER */ +static void set_icon(sxfe_t *this) +{ +# include "vdrlogo_32x32.c" + +#if defined(__WORDSIZE) && (__WORDSIZE == 32) + /* Icon */ + XChangeProperty(this->display, this->window[0], + XInternAtom(this->display, "_NET_WM_ICON", False), + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) &vdrlogo_32x32, + 2 + vdrlogo_32x32.width*vdrlogo_32x32.height); +#else + long q[2+32*32]; + uint32_t *p = (uint32_t*)&vdrlogo_32x32; + int i; + for (i = 0; i < 2 + vdrlogo_32x32.width*vdrlogo_32x32.height; i++) + q[i] = p[i]; + XChangeProperty(this->display, this->window[0], + XInternAtom(this->display, "_NET_WM_ICON", False), + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *) q, + 2 + vdrlogo_32x32.width*vdrlogo_32x32.height); +#endif +} + /* * sxfe_display_open * @@ -960,6 +983,17 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu if(this->window_id <= 0) { + + /* Window hint */ + XClassHint *classHint = XAllocClassHint(); + if(classHint) { + classHint->res_name = "VDR"; + classHint->res_class = "VDR"; + XSetClassHint(this->display, this->window[0], classHint); + XSetClassHint(this->display, this->window[1], classHint); + XFree(classHint); + } + /* Window name */ #ifdef FE_STANDALONE XStoreName(this->display, this->window[0], "VDR - "); @@ -970,11 +1004,7 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu #endif /* Icon */ - XChangeProperty(this->display, this->window[0], - XInternAtom(this->display, "_NET_WM_ICON", False), - XA_CARDINAL, 32, PropModeReplace, - (unsigned char *) &vdrlogo_32x32, - 2 + vdrlogo_32x32.width*vdrlogo_32x32.height); + set_icon(this); } /* Map current window */ |