From 2c3c723edde745a28346d549658f08998e006525 Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 10 Nov 2007 09:34:18 +0000 Subject: [PATCH] XPM support for X11; WM_CLASS and WM_COMMAND are now set too git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7680 d7cf8633-e32d-0410-b094-e92efae38249 --- darkplaces.xpm | 142 +++++++++++++++++++++++++++++++++++++++++++++++++ makefile.inc | 4 +- nexuiz.xpm | 142 +++++++++++++++++++++++++++++++++++++++++++++++++ vid_glx.c | 20 ++++++- 4 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 darkplaces.xpm create mode 100644 nexuiz.xpm diff --git a/darkplaces.xpm b/darkplaces.xpm new file mode 100644 index 00000000..befce123 --- /dev/null +++ b/darkplaces.xpm @@ -0,0 +1,142 @@ +/* XPM */ +static char * darkplaces_xpm[] = { +"48 48 91 1", +" c None", +". c #020300", +"+ c #120303", +"@ c #180202", +"# c #200301", +"$ c #340100", +"% c #410000", +"& c #2D0704", +"* c #11120F", +"= c #4F0701", +"- c #3F0F00", +"; c #251615", +"> c #780000", +", c #2D1514", +"' c #1D1C1A", +") c #680F01", +"! c #431A10", +"~ c #3B221D", +"{ c #2B2725", +"] c #601B02", +"^ c #9D0A00", +"/ c #55220A", +"( c #3D2B25", +"_ c #53291D", +": c #4E2E1B", +"< c #333432", +"[ c #4C2F26", +"} c #812301", +"| c #3F332F", +"1 c #6B321A", +"2 c #3F3F3D", +"3 c #7E320E", +"4 c #563B35", +"5 c #4B3E39", +"6 c #533F39", +"7 c #6D3A2F", +"8 c #943508", +"9 c #514541", +"0 c #654132", +"a c #474845", +"b c #6D442B", +"c c #7C4328", +"d c #504F4D", +"e c #674A43", +"f c #644F47", +"g c #5E514B", +"h c #B64005", +"i c #91472F", +"j c #575654", +"k c #AD4A11", +"l c #82533C", +"m c #5F5E5B", +"n c #745C54", +"o c #6C5E5A", +"p c #A25329", +"q c #825C54", +"r c #676664", +"s c #816A62", +"t c #70706E", +"u c #986951", +"v c #7D706C", +"w c #C66935", +"x c #7E7C79", +"y c #FA6400", +"z c #937B73", +"A c #9E796A", +"B c #B97557", +"C c #A67B5D", +"D c #878581", +"E c #8F8D8B", +"F c #AF8A7D", +"G c #A58D83", +"H c #9C8F8C", +"I c #979693", +"J c #B79590", +"K c #A59F9C", +"L c #DD9472", +"M c #B39D97", +"N c #EB9462", +"O c #C1A391", +"P c #D19F8D", +"Q c #D1A184", +"R c #B6B0AD", +"S c #C8C2BF", +"T c #DDC0BC", +"U c #E1C2B0", +"V c #F8BE99", +"W c #DDD3CE", +"X c #EFE4E0", +"Y c #FEE4C7", +"Z c #FDFEFA", +" ", +" ID ", +" tvr ", +" 59aI ", +" 4v2t ", +" 4I2r ", +" E[Xaj ", +" z7Xda RHrqsE ", +" f2XjaD Itj93][zH ", +" 92Wd2x Ixja2,pQDI ", +" 92Xx2t Irjb&FIx ", +" 5aZx5r Dj{,ORx ", +" xsja,eXt2r t'+XIt ", +" Mu/+|<<;[Xr2r j!AXjt ", +" Kq3=[222a,5Xt2r 5;SSdI ", +" H;0A5222j ~oZr2t t+CWjr ", +" z37(2<2ax c #262626", +", c #282828", +"' c #2A2A2A", +") c #2D2D2D", +"! c #313131", +"~ c #343434", +"{ c #383838", +"] c #3A3A3A", +"^ c #3E3E3E", +"/ c #414141", +"( c #434343", +"_ c #454545", +": c #474747", +"< c #4B4B4B", +"[ c #515151", +"} c #595959", +"| c #5C5C5C", +"1 c #5E5E5E", +"2 c #606060", +"3 c #626262", +"4 c #656565", +"5 c #696969", +"6 c #6B6B6B", +"7 c #6E6E6E", +"8 c #727272", +"9 c #747474", +"0 c #777777", +"a c #7B7B7B", +"b c #7F7F7F", +"c c #828282", +"d c #848484", +"e c #868686", +"f c #888888", +"g c #8B8B8B", +"h c #8D8D8D", +"i c #8F8F8F", +"j c #929292", +"k c #949494", +"l c #969696", +"m c #989898", +"n c #9C9C9C", +"o c #9F9F9F", +"p c #A3A3A3", +"q c #A6A6A6", +"r c #AAAAAA", +"s c #ACACAC", +"t c #AEAEAE", +"u c #B1B1B1", +"v c #B3B3B3", +"w c #B5B5B5", +"x c #B7B7B7", +"y c #BABABA", +"z c #BCBCBC", +"A c #BFBFBF", +"B c #C3C3C3", +"C c #C5C5C5", +"D c #C7C7C7", +"E c #C9C9C9", +"F c #CCCCCC", +"G c #CFCFCF", +"H c #D2D2D2", +"I c #D5D5D5", +"J c #D7D7D7", +"K c #D9D9D9", +"L c #DBDBDB", +"M c #DDDDDD", +"N c #DFDFDF", +"O c #E2E2E2", +"P c #E4E4E4", +"Q c #E7E7E7", +"R c #E9E9E9", +"S c #EBEBEB", +"T c #EEEEEE", +"U c #F2F2F2", +"V c #F4F4F4", +"W c #F6F6F6", +"X c #F8F8F8", +"Y c #FBFBFB", +"Z c #FEFEFE", +" ", +" ZWQQVZZ ", +" YI02kFQYZ ", +" ZJ~..+2vQY ", +" ZS7.....0OZ ", +" Yx......nU ", +" ZI$.....

KZ ZE......7S ", +" S7....0T Yz......pW ", +" ZK,....tX Ys......BY ", +" Yw....-JZ Vk.....'LZ ", +" T9....aT T8.....7S ", +" ZJ-....BY O:.....rX ", +" Xs....[PZ ZJ=....@GZ ", +" ZM_....xX YB.....GY T0.....AY ", +" ZTd....uW ZO/....^MZ ", +" YA+...iTZ YE.....kU ", +" YJ(...fQZ Uj....*HZ ", +" ZSb...fQZ ZN^....bT ", +" Wu#.%nQZ YA....*GY ", +" YG<.^AUZ ZQ5....eT ", +" To}eIXZ ZZYWu....)IY ", +" WHITY ZSCu,....pV ", +" ZXZZ Ww,.....}NZ ", +" YC+....=DY ", +" ZQ2....pV ", +" YA...0QZ ", +" ZQ5.|JY ", +" YQGPY ", +" "}; diff --git a/vid_glx.c b/vid_glx.c index 0bd0351f..35f70de0 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include #include #if !defined(__APPLE__) && !defined(__MACH__) && !defined(SUNOS) @@ -36,6 +37,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" +#include "nexuiz.xpm" +#include "darkplaces.xpm" + // Tell startup code that we have a client int cl_available = true; @@ -622,6 +626,8 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate int i; int attrib[32]; XSetWindowAttributes attr; + XClassHint *clshints; + XWMHints wmhints; unsigned long mask; Window root; XVisualInfo *visinfo; @@ -759,7 +765,19 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; win = XCreateWindow(vidx11_display, root, 0, 0, width, height, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr); - XStoreName(vidx11_display, win, gamename); + + wmhints.flags = 0; + if(XpmCreatePixmapFromData(vidx11_display, win, + (gamemode == GAME_NEXUIZ) ? nexuiz_xpm : darkplaces_xpm, + &wmhints.icon_pixmap, &wmhints.icon_mask, NULL) == XpmSuccess) + wmhints.flags |= IconPixmapHint | IconMaskHint; + + clshints = XAllocClassHint(); + clshints->res_name = strdup(gamename); + clshints->res_class = strdup("DarkPlaces"); + + XmbSetWMProperties(vidx11_display, win, gamename, gamename, (char **) com_argv, com_argc, NULL, &wmhints, clshints); + //XStoreName(vidx11_display, win, gamename); XMapWindow(vidx11_display, win); // LordHavoc: making the close button on a window do the right thing -- 2.39.2