diff --git a/BUGFORM b/BUGFORM index 0b66e379..274f8f27 100644 --- a/BUGFORM +++ b/BUGFORM @@ -35,9 +35,6 @@ to bugs@windowmaker.org [ ] --enable-kanji [ ] --disable-shape [ ] --enable-single-icon -[ ] --enable-kde -[ ] --enable-gnome -[ ] --enable-openlook [ ] --enable-modelock [ ] Others: ....................... diff --git a/BUGS b/BUGS index df19f4dc..c80546b2 100644 --- a/BUGS +++ b/BUGS @@ -3,8 +3,6 @@ Newly added show their windows minimized. normal restart is unaffected - after a crash, wmaker will completely mess the window's saved geometries and maximizing will have weird results. restart is unaffected -- after a crash/restart the child process keeps accumulating command line - options (one for each restart/crash) - wmaker will not stop managing a screen even if another window manager requests that, through the ICCCM 2.0 manager selection stuff diff --git a/FAQ b/FAQ index f0fbb99b..fcb47992 100644 --- a/FAQ +++ b/FAQ @@ -365,8 +365,8 @@ for your convenience. 2.8 Can I use WindowMaker with KDE or GNOME or CDE? ----------------------------------- -Contrary to a lot of people thinks, KDE is NOT a window manager. KDE is +--------------------------------------------------- +Contrary to a lot of people think, KDE is NOT a window manager. KDE is a suite of various applications that includes a custom window manager (kwm). The same is true for CDE. @@ -386,7 +386,7 @@ mouse. 2.9 How do I get Window Maker working with xdm in Redhat 5.[01]? ----------------------------------- +---------------------------------------------------------------- After running wmaker.inst and letting it write to .xinitrc, cp .xinitrc .xsession and make sure that /usr/local/bin is in your $PATH for the Xserver. You can @@ -1311,14 +1311,8 @@ in routines/xsci/jpc_SGraph.c 5.12 Netscape shows black and white icons ---------------------------------- -This is because Netscape uses monochrome icons when running under olwm -and you are using the OPEN LOOK emulation option. If you do not use any XView -apps anyway, recompile Window Maker without the --enable-openlook option. -If you need OPEN LOOK emulation, you will have to get used to the monochrome -icons or change then manually in the Attributes panel for each window. -I have also seen this happen on some systems if you run Netscape in a high -colour depth (32bpp) regardless of whether you're using openlook or not. -That is a Netscape bug. Therefore, bug Netscape. +I have seen this happen on some systems if you run Netscape in a high +colour depth (32bpp). That is a Netscape bug. Therefore, bug Netscape. 5.13 Snow flakes from xsnow don't acumulate on titlebars! @@ -1470,11 +1464,14 @@ the files manually. Or download the whole distribution. 7.5 Will you add GNOME or KDE support? ----------------------------------- +-------------------------------------- Support for GNOME (and KDE) hints is included since 0.50.0. You have to enable them at compile-time using the appropriate arguments to ./configure. Please read the INSTALL file for more details. +Note: starting with version 0.90.0, support for legacy Gnome-1.x and KDE-2.x +was dropped in favor of NETWM support (used by both Gnome-2.x and KDE-3.x) + -=-=-=-=- Themes: diff --git a/INSTALL b/INSTALL index b2381f6b..10a4740e 100644 --- a/INSTALL +++ b/INSTALL @@ -128,9 +128,9 @@ CONFIGURE OPTIONS: These options can be passed to the configure script to enable/disable some Window Maker features. Example: -./configure --enable-kde --enable-gnome +./configure --enable-modelock --disable-gif -will configure Window Maker with KDE and GNOME supported compiled in. +will configure Window Maker with modelock supported and disable gif support. To get a list of other options, run ./configure --help @@ -153,15 +153,6 @@ To get a list of other options, run ./configure --help --disable-motif disable support for mwm window manager hints ---enable-openlook - enable support for OPEN LOOK(tm) window manager hints - ---enable-gnome - enable support for GNOME window manager hints - ---enable-kde - enable support for kde/kwm window manager hints - --enable-lite remove things that are already supported in desktop environments, like KDE and GNOME. Disabled things are: window list, root @@ -352,9 +343,9 @@ following. to get a complete listing of other options that are available. 2. Run configure with the options you want. For example, if you - want to use the --enable-kde option, type: + want to use the --enable-modelock option, type: - ./configure --enable-kde + ./configure --enable-modelock 3. (optional) Edit src/wconfig.h with your favorite text editor and browse through it for some options you might want to change. diff --git a/INSTALL.cs b/INSTALL.cs index fac0c0ee..29da4868 100644 --- a/INSTALL.cs +++ b/INSTALL.cs @@ -153,15 +153,6 @@ Seznam ostatn --disable-motif zaká¾e podporu pokynù pro okenní mana¾er mwm. ---enable-openlook - povolí podporu pokynù pro okenní mana¾er OPEN LOOK(tm). - ---enable-gnome - povolí podporu pokynù pro GNOME. - ---enable-kde - povolí podporu pokynù pro KDE. - --enable-lite odstraní nástroje a funkce, které jsou u¾ dostupné v desktopových prosøedích KDE a GNOME. Odstraní se: seznam oken, menu aplikací, diff --git a/INSTALL.es b/INSTALL.es index d5c44876..c3d9825b 100644 --- a/INSTALL.es +++ b/INSTALL.es @@ -165,15 +165,6 @@ Para obtener una lista de otras opciones, ejecute ./configure --help --disable-motif desactiva el soporte para el gestor de ventanas mwm. ---enable-openlook - activa el soporte para el gestor de ventanas OPEN LOOK(tm) - ---enable-gnome - activa el soporte para el gestor de ventanas GNOME. - ---enable-kde - activa el soporte para el gestor de ventanas kde/kwm. - --enable-lite quita cosas que ya están soportadas en los entornos de escritorio, tal como KDE y Gnome. Desactiva cosas como: lista de ventanas, diff --git a/INSTALL.fr b/INSTALL.fr index 92dc02bb..bda375ca 100644 --- a/INSTALL.fr +++ b/INSTALL.fr @@ -167,18 +167,6 @@ Afin d'obtenir la liste des autres options, ex désactive le support pour les fonctionnalités en rapport avec le gestionnaire de fenêtres mwm. ---enable-openlook - désactive le support pour les fonctionnalités en rapport avec le gestionnaire - de fenêtres OPEN LOOK(tm). - ---enable-gnome - désactive le support pour les fonctionnalités en rapport avec le gestionnaire - de fenêtres GNOME. - ---enable-kde - désactive le support pour les fonctionnalités en rapport avec le gestionnaire - de fenêtres kde/kwm. - --enable-lite désactive des fonctionnalités déjà prises en compte par les gestionnaires de bureau tels que KDE et GNOME. Celà concerne : la liste de fenêtres, le menu diff --git a/INSTALL.pt b/INSTALL.pt index ae359cfd..dbb87a5b 100644 --- a/INSTALL.pt +++ b/INSTALL.pt @@ -155,15 +155,6 @@ Para obter uma lista com outras opcoes, execute ./configure --help: --disable-motif Desativa compatibilidade com gerenciador de janelas mwm. ---enable-openlook - Ativa compatibilidade com gerenciador de janelas OPEN LOOK(tm). - ---enable-gnome - Ativa compatibilidade com gerenciador de janelas GNOME. - ---enable-kde - Ativa compatibilidade com gerenciador de janelas kde/kwm. - --enable-lite Remove coisas que já são suportadas em ambientes desktops como o KDE e o GNOME. As opções desativadas são: lista de janelas (window list), menu de diff --git a/INSTALL.sk b/INSTALL.sk index 4af07cc7..a5d1de0e 100644 --- a/INSTALL.sk +++ b/INSTALL.sk @@ -161,15 +161,6 @@ Zoznam v --disable-motif zaká¾e podporu pre pokyny mana¾éra okien wmw ---enable-openlook - povolí podporu pre pokyny mana¾éra okien OPEN LOOK(tm) - ---enable-gnome - povolí podporu pre pokyny mana¾éra okien GNOME - ---enable-kde - povolí podporu pre pokyny mana¾éra okien kde/kwm - --enable-lite odstráni veci, ktoré sa u¾ nachádzajú v desktopových prostrediach ako KDE a GNOME. Odstránené veci sú: zoznam okien, menu aplikácií, diff --git a/Install b/Install index f1a95a6d..49c119d2 100755 --- a/Install +++ b/Install @@ -124,33 +124,6 @@ echo echo "Option Selection" echo "================" -######################## KDE -echo -echo "Do you want KDE support?" -echo -n " [n] " -read kde -if [ "$kde" = y -o "$kde" = Y ]; then - OPTIONS="$OPTIONS --enable-kde" -fi - -######################## GNOME -echo -echo "Do you want GNOME support?" -echo -n " [n] " -read gnome -if [ "$gnome" = y -o "$gnome" = Y ]; then - OPTIONS="$OPTIONS --enable-gnome" -fi - -######################## OLWM -echo -echo "Do you want OPEN LOOK(tm)/olwm support?" -echo -n " [n] " -read olwm -if [ "$olwm" = y -o "$olwm" = Y ]; then - OPTIONS="$OPTIONS --enable-openlook" -fi - ######################## NLS echo echo "Do you want National Language Support?" diff --git a/Makefile.am b/Makefile.am index cddf023d..c7dd92b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,8 +5,8 @@ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\ EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N FAQ.I18N.cs FAQ.I18N.sk \ Install INSTALL.cs INSTALL.fr INSTALL.es INSTALL.pt INSTALL.sk \ - README.definable-cursor README.pt README.KDE README.GNOME \ - MIRRORS COPYING.WTFPL mkpatch WindowMaker.lsm.in + README.definable-cursor README.pt MIRRORS COPYING.WTFPL mkpatch \ + WindowMaker.lsm.in # libwmfun-0.0.3.tar.gz WindowMaker.lsm: WindowMaker.lsm.in diff --git a/README b/README index 66de0cd3..bb4be979 100644 --- a/README +++ b/README @@ -51,7 +51,8 @@ Window Maker was designed keeping integration with GNUstep in mind and is the (www.gnu.org) Read more about GNUstep further on this file. Hints (information given by applications to integrate well with the window -manager) for Motif(tm), OPEN LOOK(tm), KDE and GNOME are also supported. +manager) for Motif(tm) and NETWM are also supported (NETWM is used by KDE +and GNOME, so they are automatically supported as a result). So you can replace any of the window managers for these environments with Window Maker while keeping most, if not all, of the native window manager functionality. @@ -220,31 +221,6 @@ Note that you must compile Window Maker with the --enable-sound configure flag and set the DisableSound option to NO. -OpenL**k support -================ - -I guess many users, mainly from the academic world, have to use -applications written using the OpenL**k toolkits, so having support -for these apps must be of some use. - -To enable, use --enable-openlook when doing the configure. Note that -not everything is implemented. - -Implemented stuff include decoration hints and the push-pin. Not implemented -stuff include _SUN_WINDOW_STATE (the compose led state stuff), drag and drop -interest stuff, header (not sure what's it) and footer strings. - -Please give me feedback if something doesn't work. If the feature is -already implemented, but is not working because of a bug, I'll try to -have that fixed. If it's a non-implemented feature and you mention that -it's important (ie: not just cosmetical), I'll consider implementing it. - -The "out" state of the pushpin is emulated as a pushed-in close button. -Just click on the button to make it pushed-out, which corresponds -to the pinned-in state of the pushpin. If you push again in the pushed-out -close button, it will act as a normal close button: it will close the window. - - Performance Tuning ================== diff --git a/README.GNOME b/README.GNOME deleted file mode 100644 index 0cf34fa2..00000000 --- a/README.GNOME +++ /dev/null @@ -1,53 +0,0 @@ - -Information on Using Window Maker with GNOME --------------------------------------------- - - -Status of GNOME support ------------------------ - - -GNOME window manager protocols seem to be a work in progress. -Things still change fairly frequently, so, the stuff implemented -may not reflect the latest protocol. If something doesn't work, -that's probably because the protocols have changed again and I still -didn't have time to reimplement everything or noticed that it -changed. If that happens, please tell me exactly what doesn't work. - -Other than that, the so called "GNOME Window Manager Compliance - How to -write a GNOME compliant Window Manager" document, says this: - - "There are currently a set of other hints available that are, at the - current time, not essential and therefore not documented here. It is, - however envisaged that they will be finalized and added to this - document, but for now are not needed." - -Since they are non-essential and undocumented they are not yet implemented. - - -Implemented stuff: - -- GNOME window manager hints -- Motif window manager hints - -On the works: - -- R6 style session management - - -Compilation/Installation ------------------------- - -To compile Window Maker with GNOME support, just configure it as: -./configure --enable-gnome - -before compiling. - -Also, do not disable mwm hints support (they are enabled by default). - - -Configuration -------------- - -In WPrefs, go to the last section and toggle the "Disable miniwindows" option. - diff --git a/README.KDE b/README.KDE deleted file mode 100644 index faa6628b..00000000 --- a/README.KDE +++ /dev/null @@ -1,125 +0,0 @@ - - -Information on Using Window Maker with KDE ------------------------------------------- - - -Window Maker supports almost all KDE/KWM specific client -communication protocols, so you can simply replace kwm with -Window Maker, if you think these advantages are worthy: - - Window Maker KWM -============================================================================= -Looks NEXTSTEP(tm)/NEXTSTEP(tm) Original, but reminds - enhanced Windows(tm) - -Decoration solid, gradient, multi-color solid, vertical and -Textures gradient, pixmaps, textured horizontal gradient, - gradient - all gradients are pixmap - supported in horizontal, - vertical and diagonal - directions - -Configurable No Yes, but not totally -Titlebar Buttons - -Mini CLI Yes, but limited Yes - -Window Specific Yes In KDE 1.1, yes. -Configuration In KDE 1.0, no. - -Quick Keyboard Yes In KDE 1.1, yes -Navigation In KDE 1.0, no. - -Pager KDE pagers will work as Yes - well as GNOME pagers - -Session Not yet supported, but Yes, old (pre-X11R6) style -Management X11R6 style SM is being worked. - -Dock kpanel, GNOME panel and Dock kpanel - -Built-in Yes No - krootbgwm - -GNOME support Yes No - -Memory Usage(1) 1.85Mb In KDE 1.0, 3.13Mb - In KDE 1.1, probably more - - -(1) Memory usage was tested by running wmaker and kwm at the same machine -with the same windows, on the same screen and similar window texture -configurations (at different times, of course). I looked in the output of -ps -m, in the SIZE field, right after starting the window managers. - - - -Enabling KDE Support --------------------- - -To enable KDE support in Window Maker, you must compile it after -configuring it as follows: -./configure --enable-kde - -Then, just replace kwm with wmaker in your startkde script. -If you are going to use Window Makers sound server, comment out -kwmsound in startkde. Also if wmaker sets your root window -background, comment out kbgndwm, kde's wallpaper setter. - -Make sure to disable workspace background setting in KDE. If you -wont be using Window Maker themes anyway, you can set -WorkspaceBack = (none); - -in ~/GNUstep/Defaults/WindowMaker - - -Enhancing Integration ---------------------- - -Window Maker adds some extensions to KDE's messaging stuff, so you can run -Window Maker specific commands from places like kpanel, krootwm or even -kwmcom. Recently KDE developers have kindly added support for these extensions -in the more recent KDE versions from CVS. The added stuff are the following -kwm like commands: - -wm:wmaker - select Window Maker support mode -wmaker:info - show info panel -wmaker:legal - show legal panel -wmaker:arrangeIcons - arrange icons -wmaker:showAll - show all windows -wmaker:hideOthers - hide others -wmaker:restart - restart wmaker -wmaker:exit - exit wmaker - -You can test them with kwmcom, like: -kwmcom wmaker:info - - -Problems --------- - -* kpanel will not be kept always on top. That's because kpanel is an -OverrideRedirect window, so Window Maker can't do anything about that. - -Before requesting for a hack to work around that in Window Maker, please -request the kpanel author to fix it. - -* because the KDE protocol for letting the window manager know the usable -window region is broken, you might find some problems with the window -positioning/maximization code and kpanel's position. - -* It seems kpanel (and maybe KDE in general) doesn't like dynamically -changing the number of workspaces. So, don't create or destroy workspaces -while running on KDE, unless you really need. - -* If kpanel, kwmpager or kpager becomes confused about the number of -windows present, restart them. - -* Wmaker opens windows by default under/over the panel, when the panel is -at top or left of screen. Use the GUI configuration tool WPrefs to change -this. - -* Some commands, such as cascade windows and rearrange windows are not -yet implemented. - diff --git a/README.es b/README.es index 1c30970e..fa8ece59 100644 --- a/README.es +++ b/README.es @@ -217,31 +217,6 @@ http://shadowmere.student.utwente.nl/ Note que debe compilar Window Maker con el parámetro --enable-sound y definir la opción DisableSound a NO. -Soporte para OpenL**k -===================== - -Calculo que muchos usuarios, principalmente del mundo académico, -tienen que usar aplicaciones escritas usando los toolkits OpenL**k, -así que tener soporte para estas aplicaciones debe ser de algún uso. - -Para activarlo, use --enable-openlook al hacer el configure. Note que -no todo está implementado. - -Las cosas implementadas incluyen consejos de adorno y el push-pin. Las cosas -no implementadas incluyen _SUN_WINDOW_STATE (la cosa compuesta que lleva el estado), -cosas que interesan sobre arrastrar y soltar, cabecera (no estoy seguro de que sea así) -y cadenas footer. - -Por favor hágame saber si algo no funciona. Si la característica ya está implimentada, -pero no funciona por un error, intentaré arreglarlo. Si esta es una característica no -implementada y menciona que es importante (obs: no solo superficial), consideraré -implementarlo. - -El estado "out" del pushpin es emular un botón presionado. Solo cliquee -en el botón para hacer que se libere, lo cuál corresponde al estado -pinned-in del pushpin. Si pulsa otra vez en el boton liberado, servirá de -botón normal de cerrado: cerrará la ventana. - Ajuste de Rendimiento. ===================== diff --git a/README.pt b/README.pt index 2a51d702..3be75239 100644 --- a/README.pt +++ b/README.pt @@ -210,34 +210,6 @@ Observe que voc flag --enable-sound e definindo a opção DisableSound para NO. -Suporte ao OpenL**k -=================== - -Acredito que muitos usuários, principalmente os do mundo acadêmico, -tenham que usar aplicações escritas em toolkits OpenL**k, então o suporte -para estes aplicativos deve ser de algum uso. - -Para ativar, use o --enable-openlook quando rodar o configure. Note -que nem tudo está implementado. - -As opções implementadas incluem hints de decoração e o push-pin. -Coisas não implementadas incluem _SUN_WINDOW_STATE (the compose led -state stuff), coisas relacionadas ao "drag and drop", cabeçalho (não -tenho certeza do que é) e o string footer. - -Por favor me dêem retorno se algo não funcionar. Se a opção já está -implementada, mas não está funcionando por causa de um bug, eu tentarei -corrigí-la. Se é uma característica ainda não implementada e você mencionar -que é importante (ie: não somente cosmética), eu considerarei a sua -implementação. - -O estado "out" do pushpin é emulado como um botão de fechar pressionado. -Clique no botão para fazer com que ele fique despressionado, o que -corresponde ao estado "pinned-in" do pushpin. Se você pressionar de novo -o botão de fechar despressionado, ele vai agir como um botão de fechar -normal: vai fechar a janela. - - Ajuste da Performance ==================== diff --git a/TODO b/TODO index ad4501ea..cb57bbfd 100644 --- a/TODO +++ b/TODO @@ -16,7 +16,6 @@ To do before next release: - clean up netwm hints on exit - check whether window states are being saved/restored properly via netwm on restart/crash-restart (grep for XXX/TODO) -- remove legacy stuff for openlook/gnome-1/kde-1 (don't forget to remove README.KDE/.GNOME) - review wmaker.inst remake wrlib rule to not compile with -fomit-frame-pointer and stuff diff --git a/WINGs/WINGs/WINGsP.h b/WINGs/WINGs/WINGsP.h index 9d76b128..ca3451cc 100644 --- a/WINGs/WINGs/WINGsP.h +++ b/WINGs/WINGs/WINGsP.h @@ -43,20 +43,12 @@ typedef struct W_Application { typedef struct W_Font { struct W_Screen *screen; -#ifdef XFT struct _XftFont *font; -#else - // pick one - //XFontSet font; - XFontStruct *font; -#endif short height; short y; short refCount; char *name; - //unsigned int notFontSet:1; - //unsigned int antialiased:1; } W_Font; diff --git a/WINGs/configuration.c b/WINGs/configuration.c index 7d8d0c15..24df488d 100644 --- a/WINGs/configuration.c +++ b/WINGs/configuration.c @@ -103,12 +103,8 @@ W_ReadConfigurations(void) WINGsConfiguration.boldSystemFont = WMGetUDStringForKey(defaults, "BoldSystemFont"); -#ifdef XFT WINGsConfiguration.antialiasedText = WMGetUDBoolForKey(defaults, "AntialiasedText"); -#else - WINGsConfiguration.antialiasedText = False; -#endif WINGsConfiguration.useMultiByte = False; str = WMGetUDStringForKey(defaults, "MultiByteText"); diff --git a/WINGs/wfont.c b/WINGs/wfont.c index 8cc16450..0201735b 100644 --- a/WINGs/wfont.c +++ b/WINGs/wfont.c @@ -1,8 +1,6 @@ #include "wconfig.h" -#ifdef XFT - #include #include @@ -381,6 +379,4 @@ WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style) } -#endif /* XFT */ - diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c index 48fe933f..280faf74 100644 --- a/WINGs/wfontpanel.c +++ b/WINGs/wfontpanel.c @@ -9,10 +9,8 @@ #include #include -#ifdef XFT #include #include -#endif /* XXX TODO */ @@ -85,9 +83,7 @@ static int scalableFontSizes[] = { -#ifdef XFT static void setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double size); -#endif static int isXLFD(char *font, int *length_ret); @@ -367,7 +363,6 @@ WMGetFontPanelFont(WMFontPanel *panel) void WMSetFontPanelFont(WMFontPanel *panel, char *fontName) { -#ifdef XFT int fname_len; FcPattern *pattern; FcChar8 *family, *style; @@ -391,7 +386,6 @@ WMSetFontPanelFont(WMFontPanel *panel, char *fontName) setFontPanelFontName(panel, family, style, size); FcPatternDestroy(pattern); -#endif } @@ -485,66 +479,7 @@ isXLFD(char *font, int *length_ret) return c==NUM_FIELDS; } -#ifndef XFT -static Bool -parseFont(char *font, char values[NUM_FIELDS][256]) -{ - char *ptr; - int part; - char buffer[256], *bptr; - part = FOUNDRY; - ptr = font; - ptr++; /* skip first - */ - bptr = buffer; - while (*ptr) { - if (*ptr == '-') { - *bptr = 0; - strcpy(values[part], buffer); - bptr = buffer; - part++; - } else { - *bptr++ = *ptr; - } - ptr++; - } - *bptr = 0; - strcpy(values[part], buffer); - - return True; -} - - - - - -typedef struct { - char *weight; - char *slant; - - char *setWidth; - char *addStyle; - - char showSetWidth; /* when duplicated */ - char showAddStyle; /* when duplicated */ - - WMArray *sizes; -} Typeface; - - -typedef struct { - char *name; - - char *foundry; - char *registry, *encoding; - - char showFoundry; /* when duplicated */ - char showRegistry; /* when duplicated */ - - WMArray *typefaces; -} Family; -#endif -#ifdef XFT typedef struct { char *typeface; WMArray *sizes; @@ -554,9 +489,6 @@ typedef struct { char *name; /* gotta love simplicity */ WMArray *typefaces; } Xft_Family; -#endif - - static int @@ -575,11 +507,7 @@ compare_int(const void *a, const void *b) static void -#ifdef XFT addSizeToTypeface(Xft_Typeface *face, int size) -#else -addSizeToTypeface(Typeface *face, int size) -#endif { if (size == 0) { int j; @@ -600,7 +528,6 @@ addSizeToTypeface(Typeface *face, int size) } } -#ifdef XFT static void addTypefaceToXftFamily(Xft_Family *fam, char *style) { @@ -628,57 +555,11 @@ addTypefaceToXftFamily(Xft_Family *fam, char *style) WMAddToArray(fam->typefaces, face); } -#else /* XFT */ - -static void -addTypefaceToFamily(Family *family, char fontFields[NUM_FIELDS][256]) -{ - Typeface *face; - WMArrayIterator i; - - if (family->typefaces) { - WM_ITERATE_ARRAY(family->typefaces, face, i) { - int size; - - if (strcmp(face->weight, fontFields[WEIGHT]) != 0) { - continue; - } - if (strcmp(face->slant, fontFields[SLANT]) != 0) { - continue; - } - - size = atoi(fontFields[PIXEL_SIZE]); - - addSizeToTypeface(face, size); - - return; - } - } else { - family->typefaces = WMCreateArray(4); - } - - face = wmalloc(sizeof(Typeface)); - memset(face, 0, sizeof(Typeface)); - - face->weight = wstrdup(fontFields[WEIGHT]); - face->slant = wstrdup(fontFields[SLANT]); - face->setWidth = wstrdup(fontFields[SETWIDTH]); - face->addStyle = wstrdup(fontFields[ADD_STYLE]); - - face->sizes = WMCreateArray(4); - addSizeToTypeface(face, atoi(fontFields[PIXEL_SIZE])); - - WMAddToArray(family->typefaces, face); -} -#endif - /* * families (same family name) (Hashtable of family -> array) * registries (same family but different registries) * */ - -#ifdef XFT static void addFontToXftFamily(WMHashTable *families, char *name, char *style) { @@ -709,138 +590,18 @@ addFontToXftFamily(WMHashTable *families, char *name, char *style) WMHashInsert(families, fam->name, array); } -#else /* XFT */ - -static void -addFontToFamily(WMHashTable *families, char fontFields[NUM_FIELDS][256]) -{ - WMArrayIterator i; - Family *fam; - WMArray *family; - - - family = WMHashGet(families, fontFields[FAMILY]); - - if (family) { - /* look for same encoding/registry and foundry */ - WM_ITERATE_ARRAY(family, fam, i) { - int enc, reg, found; - - enc = (strcmp(fam->encoding, fontFields[ENCODING]) == 0); - reg = (strcmp(fam->registry, fontFields[REGISTRY]) == 0); - found = (strcmp(fam->foundry, fontFields[FOUNDRY]) == 0); - - if (enc && reg && found) { - addTypefaceToFamily(fam, fontFields); - return; - } - } - /* look for same encoding/registry */ - WM_ITERATE_ARRAY(family, fam, i) { - int enc, reg; - - enc = (strcmp(fam->encoding, fontFields[ENCODING]) == 0); - reg = (strcmp(fam->registry, fontFields[REGISTRY]) == 0); - - if (enc && reg) { - /* has the same encoding, but the foundry is different */ - fam->showFoundry = 1; - - fam = wmalloc(sizeof(Family)); - memset(fam, 0, sizeof(Family)); - - fam->name = wstrdup(fontFields[FAMILY]); - fam->foundry = wstrdup(fontFields[FOUNDRY]); - fam->registry = wstrdup(fontFields[REGISTRY]); - fam->encoding = wstrdup(fontFields[ENCODING]); - fam->showFoundry = 1; - - addTypefaceToFamily(fam, fontFields); - - WMAddToArray(family, fam); - return; - } - } - /* look for same foundry */ - WM_ITERATE_ARRAY(family, fam, i) { - int found; - - found = (strcmp(fam->foundry, fontFields[FOUNDRY]) == 0); - - if (found) { - /* has the same foundry, but encoding is different */ - fam->showRegistry = 1; - - fam = wmalloc(sizeof(Family)); - memset(fam, 0, sizeof(Family)); - - fam->name = wstrdup(fontFields[FAMILY]); - fam->foundry = wstrdup(fontFields[FOUNDRY]); - fam->registry = wstrdup(fontFields[REGISTRY]); - fam->encoding = wstrdup(fontFields[ENCODING]); - fam->showRegistry = 1; - - addTypefaceToFamily(fam, fontFields); - - WMAddToArray(family, fam); - return; - } - } - /* foundry and encoding do not match anything known */ - fam = wmalloc(sizeof(Family)); - memset(fam, 0, sizeof(Family)); - - fam->name = wstrdup(fontFields[FAMILY]); - fam->foundry = wstrdup(fontFields[FOUNDRY]); - fam->registry = wstrdup(fontFields[REGISTRY]); - fam->encoding = wstrdup(fontFields[ENCODING]); - fam->showFoundry = 1; - fam->showRegistry = 1; - - addTypefaceToFamily(fam, fontFields); - - WMAddToArray(family, fam); - return; - } - - family = WMCreateArray(8); - - fam = wmalloc(sizeof(Family)); - memset(fam, 0, sizeof(Family)); - - fam->name = wstrdup(fontFields[FAMILY]); - fam->foundry = wstrdup(fontFields[FOUNDRY]); - fam->registry = wstrdup(fontFields[REGISTRY]); - fam->encoding = wstrdup(fontFields[ENCODING]); - - addTypefaceToFamily(fam, fontFields); - - WMAddToArray(family, fam); - - WMHashInsert(families, fam->name, family); -} -#endif /* XFT */ - - static void listFamilies(WMScreen *scr, WMFontPanel *panel) { -#ifdef XFT FcObjectSet *os = 0; FcFontSet *fs; FcPattern *pat; -#else /* XFT */ - char **fontList; - char fields[NUM_FIELDS][256]; - int count; -#endif /* XFT */ WMHashTable *families; WMHashEnumerator enumer; WMArray *array; int i; -#ifdef XFT pat = FcPatternCreate(); os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, 0); fs = FcFontList(0, pat, os); @@ -851,19 +612,9 @@ listFamilies(WMScreen *scr, WMFontPanel *panel) } if (pat) FcPatternDestroy (pat); -#else /* XFT */ - fontList = XListFonts(scr->display, ALL_FONTS_MASK, MAX_FONTS_TO_RETRIEVE, - &count); - if (!fontList) { - WMRunAlertPanel(scr, panel->win, _("Error"), - _("Could not retrieve font list"), _("OK"), NULL, NULL); - return; - } -#endif /* XFT */ families = WMCreateHashTable(WMStringPointerHashCallbacks); -#ifdef XFT if(fs) { for (i = 0; i < fs->nfont; i++) { FcChar8 *family; @@ -875,31 +626,9 @@ listFamilies(WMScreen *scr, WMFontPanel *panel) } FcFontSetDestroy(fs); } -#else /* XFT */ - for (i = 0; i < count; i++) { - int fname_len; - - if (!isXLFD(fontList[i], &fname_len)) { - *fontList[i] = '\0'; - continue; - } - if (fname_len > 255) { - wwarning(_("font name %s is longer than 256, which is invalid."), - fontList[i]); - *fontList[i] = '\0'; - continue; - } - if (!parseFont(fontList[i], fields)) { - *fontList[i] = '\0'; - continue; - } - addFontToFamily(families, fields); - } -#endif /* XFT */ enumer = WMEnumerateHashTable(families); -#ifdef XFT while ((array = WMNextHashEnumeratorItem(&enumer))) { WMArrayIterator i; Xft_Family *fam; @@ -915,35 +644,7 @@ listFamilies(WMScreen *scr, WMFontPanel *panel) WMFreeArray(array); } -#else /* XFT */ - while ((array = WMNextHashEnumeratorItem(&enumer))) { - WMArrayIterator i; - Family *fam; - char buffer[256]; - WMListItem *item; - WM_ITERATE_ARRAY(array, fam, i) { - strcpy(buffer, fam->name); - - if (fam->showFoundry) { - strcat(buffer, " "); - strcat(buffer, fam->foundry); - strcat(buffer, " "); - } - if (fam->showRegistry) { - strcat(buffer, " ("); - strcat(buffer, fam->registry); - strcat(buffer, "-"); - strcat(buffer, fam->encoding); - strcat(buffer, ")"); - } - item = WMAddListItem(panel->famLs, buffer); - - item->clientData = fam; - } - WMFreeArray(array); - } -#endif /* XFT */ WMSortListItems(panel->famLs); WMFreeHashTable(families); @@ -954,53 +655,28 @@ static void getSelectedFont(FontPanel *panel, char buffer[], int bufsize) { WMListItem *item; -#ifdef XFT Xft_Family *family; Xft_Typeface *face; -#else - Family *family; - Typeface *face; -#endif char *size; item = WMGetListSelectedItem(panel->famLs); if (!item) return; -#ifdef XFT family = (Xft_Family*)item->clientData; -#else - family = (Family*)item->clientData; -#endif item = WMGetListSelectedItem(panel->typLs); if (!item) return; -#ifdef XFT face = (Xft_Typeface*)item->clientData; -#else - face = (Typeface*)item->clientData; -#endif size = WMGetTextFieldText(panel->sizT); -#ifdef XFT snprintf(buffer, bufsize, "%s:style=%s:pixelsize=%s", family->name, face->typeface, size); -#else - snprintf(buffer, bufsize, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s", - family->foundry, - family->name, - face->weight, - face->slant, - face->setWidth, - face->addStyle, - size, - family->registry, - family->encoding); -#endif /* XFT */ + wfree(size); } @@ -1027,13 +703,8 @@ familyClick(WMWidget *w, void *data) { WMList *lPtr = (WMList*)w; WMListItem *item; -#ifdef XFT Xft_Family *family; Xft_Typeface *face; -#else - Family *family; - Typeface *face; -#endif FontPanel *panel = (FontPanel*)data; WMArrayIterator i; /* current typeface and size */ @@ -1051,11 +722,7 @@ familyClick(WMWidget *w, void *data) item = WMGetListSelectedItem(lPtr); -#ifdef XFT family = (Xft_Family*)item->clientData; -#else - family = (Family*)item->clientData; -#endif WMClearList(panel->typLs); @@ -1065,44 +732,11 @@ familyClick(WMWidget *w, void *data) int top=0; WMListItem *fitem; -#ifdef XFT strcpy(buffer, face->typeface); if(strcasecmp(face->typeface, "Roman") == 0) top = 1; if(strcasecmp(face->typeface, "Regular") == 0) top = 1; -#else - if (strcmp(face->weight, "medium") == 0) { - buffer[0] = 0; - } else { - if (*face->weight) { - strcpy(buffer, face->weight); - buffer[0] = toupper(buffer[0]); - strcat(buffer, " "); - } else { - buffer[0] = 0; - } - } - - if (strcmp(face->slant, "r") == 0) { - strcat(buffer, _("Roman")); - top = 1; - } else if (strcmp(face->slant, "i") == 0) { - strcat(buffer, _("Italic")); - } else if (strcmp(face->slant, "o") == 0) { - strcat(buffer, _("Oblique")); - } else if (strcmp(face->slant, "ri") == 0) { - strcat(buffer, _("Rev Italic")); - } else if (strcmp(face->slant, "ro") == 0) { - strcat(buffer, _("Rev Oblique")); - } else { - strcat(buffer, face->slant); - } - - if (buffer[0] == 0) { - strcpy(buffer, _("Normal")); - } -#endif if (top) fitem = WMInsertListItem(panel->typLs, 0, buffer); else @@ -1141,11 +775,7 @@ typefaceClick(WMWidget *w, void *data) { FontPanel *panel = (FontPanel*)data; WMListItem *item; -#ifdef XFT Xft_Typeface *face; -#else - Typeface *face; -#endif WMArrayIterator i; char buffer[32]; @@ -1157,11 +787,7 @@ typefaceClick(WMWidget *w, void *data) item = WMGetListSelectedItem(panel->typLs); -#ifdef XFT face = (Xft_Typeface*)item->clientData; -#else - face = (Typeface*)item->clientData; -#endif WMClearList(panel->sizLs); @@ -1207,7 +833,6 @@ sizeClick(WMWidget *w, void *data) } -#ifdef XFT static void setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double size) { @@ -1290,5 +915,4 @@ setFontPanelFontName(FontPanel *panel, FcChar8 *family, FcChar8 *style, double s return; } -#endif diff --git a/WINGs/widgets.c b/WINGs/widgets.c index 100ad4ad..5ed4e5ef 100644 --- a/WINGs/widgets.c +++ b/WINGs/widgets.c @@ -3,9 +3,7 @@ #include "WINGsP.h" #include "wconfig.h" -#ifdef XFT -# include -#endif +#include #include #include @@ -627,10 +625,8 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context) scrPtr->fontCache = WMCreateHashTable(WMStringPointerHashCallbacks); -#ifdef XFT scrPtr->xftdraw = XftDrawCreate(scrPtr->display, W_DRAWABLE(scrPtr), scrPtr->visual, scrPtr->colormap); -#endif /* create input method stuff */ W_InitIMStuff(scrPtr); diff --git a/WindowMaker.lsm.in b/WindowMaker.lsm.in index 18df20d1..58f0e76d 100644 --- a/WindowMaker.lsm.in +++ b/WindowMaker.lsm.in @@ -4,11 +4,11 @@ Version: VERSION Entered-date: DATE Description: N*EXTSTEP alike, good looking, fast and easy to use/configure window manager for X11. Features support for GNUstep, ICCCM, - Motif(tm), OPEN LOOK(tm), KDE and GNOME hints. Multiple - workspaces, easy to use application dock, very flexible menus, - graphical configuration, 13 types of decoration textures, - national language support, themes etc -Keywords: window-manager X11 GNUstep NEXTSTEP GNOME KDE OpenLook Motif + Motif(tm) and NETWM hints. Multiple workspaces, easy to use + application dock, very flexible menus, graphical configuration, + 13 types of decoration textures, national language support, + themes etc +Keywords: window-manager X11 GNUstep NEXTSTEP NETWM Motif XFT Author: kojima@windowmaker.org (Alfredo K. Kojima) Maintained-by: kojima@windowmaker.org (Alfredo K. Kojima) dan@windowmaker.org (Dan Pascu) diff --git a/configure.ac b/configure.ac index ea93aa89..5a6d625a 100644 --- a/configure.ac +++ b/configure.ac @@ -19,18 +19,18 @@ AM_INIT_AUTOMAKE(WindowMaker, 0.85.0) AC_PROG_LIBTOOL -# by Marcelo Magallon -# Turn around -rpath problem with libtool 1.0c -# This define should be improbable enough to not conflict with anything -case ${host} in - *-pc-linux-gnu) - AC_MSG_RESULT([Fixing libtool for -rpath problems.]) - sed < libtool > libtool-2 \ - 's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' - mv libtool-2 libtool - chmod 755 libtool - ;; -esac +dnl # by Marcelo Magallon +dnl # Turn around -rpath problem with libtool 1.0c +dnl # This define should be improbable enough to not conflict with anything +dnl case ${host} in +dnl *-pc-linux-gnu) +dnl AC_MSG_RESULT([Fixing libtool for -rpath problems.]) +dnl sed < libtool > libtool-2 \ +dnl 's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' +dnl mv libtool-2 libtool +dnl chmod 755 libtool +dnl ;; +dnl esac AM_CONFIG_HEADER(src/config.h) @@ -102,8 +102,7 @@ AC_FUNC_VPRINTF AC_FUNC_ALLOCA AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp \ setsid atexit mallinfo mkstemp snprintf vsnprintf asprintf \ - vasprintf mbsnrtowcs mbsrtowcs mbrtowc mbrlen wcsnrtombs \ - wcsrtombs wcstombs) + vasprintf) dnl ripped from samba dnl @@ -181,7 +180,7 @@ AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h \ libintl.h sys/select.h poll.h malloc.h ctype.h string.h \ - strings.h wchar.h) + strings.h) @@ -381,37 +380,8 @@ AC_SUBST(supported_locales) dnl Support for various hint things dnl =============================== -gnome_on="no" -kde_on="no" -openlook_on="no" -netwm_on="no" vdesktop_on="no" - -AC_ARG_ENABLE(gnome, - [ --enable-gnome enable stuff needed for GNOME ], - [if test x$enableval = xyes; then - AC_DEFINE(GNOME_STUFF, 1, [define if you want GNOME stuff support]) - gnome_on=yes - fi]) - - -AC_ARG_ENABLE(kde, - [ --enable-kde enable support for KDE window manager (kwm) hints ], - [if test x$enableval = xyes; then - AC_DEFINE(KWM_HINTS, 1, [define if you want KDE hint support]) - kde_on=yes - fi]) - - -AC_ARG_ENABLE(openlook, - [ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ], - [if test x$enableval = xyes; then - AC_DEFINE(OLWM_HINTS, 1, [define if you want OPEN LOOK(tm) hint support]) - openlook_on=yes - fi]) - - AC_ARG_ENABLE(vdesktop, [ --enable-vdesktop enable virtual desktop], [if test x$enableval = xyes; then @@ -583,7 +553,6 @@ fi AC_SUBST(XFTFLAGS) AC_SUBST(XFTLIBS) -AC_DEFINE(XFT, 1, [define if you want support for antialiased fonts (set by configure)]) dnl XINERAMA support @@ -1124,20 +1093,6 @@ else languages=`echo $MOFILES | sed 's/.mo//g'` fi -extrasupport='' -if test "$openlook_on" = "yes"; then - extrasupport="OpenLook $extrasupport" -fi -if test "$gnome_on" = "yes"; then -extrasupport="Gnome-1.x $extrasupport" -fi -if test "$kde_on" = "yes"; then - extrasupport="KDE-1.x $extrasupport" -fi -if test "x$extrasupport" = "x"; then - extrasupport="None" -fi - echo echo "Window Maker was configured as follows:" echo @@ -1150,7 +1105,6 @@ echo "Use inline MMX(tm) x86 assembly : $mmx_support" echo "Antialiased text support in WINGs : $xft" echo "Xinerama extension support : $xinerama" echo "Virtual desktop support : $vdesktop_on" -echo "Supported legacy environments : $extrasupport" echo "Translated message files to install : $mof" dnl echo "Supported languages beside English : $languages" if test "x$MOFILES" != "x"; then diff --git a/contrib/WindowMaker.spec.in b/contrib/WindowMaker.spec.in index 06e8c6ba..52104f7c 100644 --- a/contrib/WindowMaker.spec.in +++ b/contrib/WindowMaker.spec.in @@ -50,7 +50,6 @@ export CFLAGS LINGUAS NLSDIR GNUSTEP_LOCAL_ROOT; ./configure --prefix=/usr --exec-prefix=/usr/X11R6 \ --sysconfdir=/etc/X11 --enable-modelock \ - --enable-kde --enable-gnome --enable-openlook \ --enable-usermenu make diff --git a/po/Makefile.am b/po/Makefile.am index 5222b266..0f97af8a 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -17,9 +17,7 @@ POTFILES = \ $(top_builddir)/src/dock.c \ $(top_builddir)/src/dockedapp.c \ $(top_builddir)/src/framewin.c \ - $(top_builddir)/src/gnome.c \ $(top_builddir)/src/icon.c \ - $(top_builddir)/src/kwm.c \ $(top_builddir)/src/main.c \ $(top_builddir)/src/menu.c \ $(top_builddir)/src/menureader.c \ diff --git a/src/Makefile.am b/src/Makefile.am index ccb0d754..64c9780d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -38,14 +38,10 @@ wmaker_SOURCES = \ framewin.h \ geomview.c \ geomview.h \ - gnome.c \ - gnome.h \ funcs.h \ icon.c \ icon.h \ keybind.h \ - kwm.h \ - kwm.c \ main.c \ menu.c \ menu.h \ @@ -54,8 +50,6 @@ wmaker_SOURCES = \ motif.c \ motif.h \ moveres.c \ - openlook.c \ - openlook.h \ pixmap.c \ pixmap.h \ placement.c \ diff --git a/src/actions.c b/src/actions.c index e4248024..e3d573b6 100644 --- a/src/actions.c +++ b/src/actions.c @@ -50,14 +50,6 @@ #include "wsound.h" #include "xinerama.h" -#ifdef GNOME_STUFF -# include "gnome.h" -#endif -#ifdef KWM_HINTS -# include "kwm.h" -#endif - - /****** Global Variables ******/ extern Time LastTimestamp; @@ -434,10 +426,6 @@ wMaximizeWindow(WWindow *wwin, int directions) } wwin->flags.maximized = directions; -#ifdef KWM_HINTS - wKWMUpdateClientGeometryRestore(wwin); -#endif - if (directions & MAX_HORIZONTAL) { new_width = (usableArea.x2-usableArea.x1)-FRAME_BORDER_WIDTH*2; new_x = usableArea.x1; @@ -1014,30 +1002,20 @@ wIconifyWindow(WWindow *wwin) iw = wwin->icon->core->width; ih = wwin->icon->core->height; } else { -#ifdef KWM_HINTS - WArea area; - - if (wKWMGetIconGeometry(wwin, &area)) { - ix = area.x1; - iy = area.y1; - iw = area.x2 - ix; - ih = area.y2 - iy; - } else -#endif /* KWM_HINTS */ #ifdef NETWM_HINTS - if (wwin->flags.net_handle_icon) { - ix = wwin->icon_x; - iy = wwin->icon_y; - iw = wwin->icon_w; - ih = wwin->icon_h; - } else + if (wwin->flags.net_handle_icon) { + ix = wwin->icon_x; + iy = wwin->icon_y; + iw = wwin->icon_w; + ih = wwin->icon_h; + } else #endif - { - ix = 0; - iy = 0; - iw = wwin->screen_ptr->scr_width; - ih = wwin->screen_ptr->scr_height; - } + { + ix = 0; + iy = 0; + iw = wwin->screen_ptr->scr_width; + ih = wwin->screen_ptr->scr_height; + } } animateResize(wwin->screen_ptr, wwin->frame_x, wwin->frame_y, wwin->frame->core->width, wwin->frame->core->height, @@ -1192,30 +1170,20 @@ wDeiconifyWindow(WWindow *wwin) iw = wwin->icon->core->width; ih = wwin->icon->core->height; } else { -#ifdef KWM_HINTS - WArea area; - - if (wKWMGetIconGeometry(wwin, &area)) { - ix = area.x1; - iy = area.y1; - iw = area.x2 - ix; - ih = area.y2 - iy; - } else -#endif /* KWM_HINTS */ #ifdef NETWM_HINTS - if (wwin->flags.net_handle_icon) { - ix = wwin->icon_x; - iy = wwin->icon_y; - iw = wwin->icon_w; - ih = wwin->icon_h; - } else + if (wwin->flags.net_handle_icon) { + ix = wwin->icon_x; + iy = wwin->icon_y; + iw = wwin->icon_w; + ih = wwin->icon_h; + } else #endif - { - ix = 0; - iy = 0; - iw = wwin->screen_ptr->scr_width; - ih = wwin->screen_ptr->scr_height; - } + { + ix = 0; + iy = 0; + iw = wwin->screen_ptr->scr_width; + ih = wwin->screen_ptr->scr_height; + } } animateResize(wwin->screen_ptr, ix, iy, iw, ih, wwin->frame_x, wwin->frame_y, diff --git a/src/client.c b/src/client.c index f00e6eb0..6cec8119 100644 --- a/src/client.c +++ b/src/client.c @@ -43,9 +43,6 @@ #include "stacking.h" #include "appicon.h" #include "appmenu.h" -#ifdef KWM_HINTS -#include "kwm.h" -#endif #ifdef NETWM_HINTS # include "wmspec.h" #endif @@ -339,9 +336,6 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event) break; case XA_WM_ICON_NAME: -#ifdef KWM_HINTS - wKWMSendEventMessage(wwin, WKWMChangedClient); -#endif if (!wwin->icon) break; else { @@ -504,9 +498,6 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event) if (wapp && wapp->app_icon) { wIconUpdate(wapp->app_icon->icon); } -#ifdef KWM_HINTS - wKWMSendEventMessage(wwin, WKWMIconChange); -#endif } if (wwin->wm_hints->flags & UrgencyHint) @@ -663,17 +654,8 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event) XFree(attr); } else { -#if defined(KWM_HINTS) || defined(NETWM_HINTS) - Bool done = False; -#endif -#ifdef KWM_HINTS - if (!done) - done = wKWMCheckClientHintChange(wwin, event); -#endif /* KWM_HINTS */ #ifdef NETWM_HINTS - if (!done) { - done = wNETWMCheckClientHintChange(wwin, event); - } + wNETWMCheckClientHintChange(wwin, event); #endif } } diff --git a/src/dialog.c b/src/dialog.c index c021152d..09c588b6 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1370,21 +1370,12 @@ wShowInfoPanel(WScreen *scr) char buf[80]; int j = 0; -#ifdef MWM_HINTS - list[j++] = "MWM"; -#endif -#ifdef KWM_HINTS - list[j++] = "KDE"; -#endif -#ifdef GNOME_STUFF - list[j++] = "GNOME"; -#endif -#ifdef OLWM_HINTS - list[j++] = "OLWM"; -#endif #ifdef NETWM_HINTS list[j++] = "WMSPEC"; #endif +#ifdef MWM_HINTS + list[j++] = "MWM"; +#endif buf[0] = 0; for (i = 0; i < j; i++) { @@ -1405,12 +1396,10 @@ wShowInfoPanel(WScreen *scr) strbuf = wstrappend(strbuf, _("\nSound enabled")); } -#ifdef XFT strbuf = wstrappend(strbuf, _("; Antialiased text")); -#endif #ifdef VIRTUAL_DESKTOP - strbuf = wstrappend(strbuf, _("; VirtualDesktop")); + strbuf = wstrappend(strbuf, _(", VirtualDesktop")); #endif #ifdef XINERAMA diff --git a/src/event.c b/src/event.c index e61fddd8..e9f352e8 100644 --- a/src/event.c +++ b/src/event.c @@ -60,12 +60,6 @@ #include "balloon.h" #include "xinerama.h" -#ifdef GNOME_STUFF -# include "gnome.h" -#endif -#ifdef KWM_HINTS -# include "kwm.h" -#endif #ifdef NETWM_HINTS # include "wmspec.h" #endif @@ -627,10 +621,6 @@ handleDestroyNotify(XEvent *event) } wApplicationDestroy(app); } - -#ifdef KWM_HINTS - wKWMCheckDestroy(&event->xdestroywindow); -#endif } @@ -724,10 +714,6 @@ handleButtonPress(XEvent *event) wPreferences.mouse_wheel!=WA_NONE) { wWorkspaceRelativeChange(scr, -1); } -#ifdef GNOME_STUFF - else if (wGNOMEProxyizeButtonEvent(scr, event)) - return; -#endif } #endif /* !LITE */ @@ -897,11 +883,6 @@ handlePropertyNotify(XEvent *event) } scr = wScreenForWindow(event->xproperty.window); - if (scr && scr->root_win == event->xproperty.window) { -#ifdef KWM_HINTS - wKWMCheckRootHintChange(scr, &event->xproperty); -#endif - } } @@ -1001,14 +982,6 @@ handleClientMessage(XEvent *event) } else if (wNETWMProcessClientMessage(&event->xclient)) { /* do nothing */ #endif -#ifdef GNOME_STUFF - } else if (wGNOMEProcessClientMessage(&event->xclient)) { - /* do nothing */ -#endif /* GNOME_STUFF */ -#ifdef KWM_HINTS - } else if (wKWMProcessClientMessage(&event->xclient)) { - /* do nothing */ -#endif /* KWM_HINTS */ #ifdef XDND } else if (wXDNDProcessClientMessage(&event->xclient)) { /* do nothing */ diff --git a/src/framewin.c b/src/framewin.c index f8664bed..74ef61ed 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -1272,19 +1272,6 @@ wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title) } -#ifdef OLWM_HINTS -void -wFrameWindowUpdatePushButton(WFrameWindow *fwin, Bool pushed) -{ - fwin->flags.right_button_pushed_in = pushed; - - paintButton(fwin->right_button, fwin->title_texture[fwin->flags.state], - WMColorPixel(fwin->title_color[fwin->flags.state]), - fwin->rbutton_image, pushed); -} -#endif /* OLWM_HINTS */ - - #ifdef XKB_BUTTON_HINT void wFrameWindowUpdateLanguageButton(WFrameWindow *fwin) @@ -1467,16 +1454,9 @@ handleButtonExpose(WObjDescriptor *desc, XEvent *event) WMColorPixel(fwin->title_color[fwin->flags.state]), fwin->lbutton_image, False); } else { - Bool pushed = False; - -#ifdef OLWM_HINTS - if (fwin->flags.right_button_pushed_in) - pushed = True; -#endif - /* emulate the olwm pushpin in the "out" state */ paintButton(button, fwin->title_texture[fwin->flags.state], WMColorPixel(fwin->title_color[fwin->flags.state]), - fwin->rbutton_image, pushed); + fwin->rbutton_image, False); } } diff --git a/src/framewin.h b/src/framewin.h index 88887a90..18ba07b7 100644 --- a/src/framewin.h +++ b/src/framewin.h @@ -143,10 +143,6 @@ typedef struct WFrameWindow { unsigned int is_client_window_frame:1; unsigned int incomplete_title:1; - -#ifdef OLWM_HINTS - unsigned int right_button_pushed_in:1; -#endif } flags; } WFrameWindow; @@ -176,10 +172,6 @@ void wFrameWindowHideButton(WFrameWindow *fwin, int flags); int wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title); -#ifdef OLWM_HINTS -void wFrameWindowUpdatePushButton(WFrameWindow *fwin, Bool pushed); -#endif - #ifdef XKB_BUTTON_HINT void wFrameWindowUpdateLanguageButton(WFrameWindow *fwin); #endif diff --git a/src/gnome.c b/src/gnome.c deleted file mode 100644 index 0d15cc25..00000000 --- a/src/gnome.c +++ /dev/null @@ -1,731 +0,0 @@ -/* gnome.c-- support for the GNOME Hints - * - * Window Maker window manager - * - * Copyright (c) 1998-2003 Alfredo K. Kojima - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -/* - * According to the author of this thing, it should not be taken seriously. - * IMHO, there are lot's of weirdnesses and it's quite unelegant. I'd - * rather not support it, but here it goes anyway. - */ - -#include "wconfig.h" - -#ifdef GNOME_STUFF - -#include -#include -#include - -#include -#include -#include - - -#include "WindowMaker.h" -#include "screen.h" -#include "wcore.h" -#include "framewin.h" -#include "window.h" -#include "workspace.h" -#include "funcs.h" -#include "actions.h" -#include "stacking.h" -#include "client.h" -#include "xinerama.h" - -#include "gnome.h" - - - - - - -#define WIN_HINTS_SKIP_FOCUS (1<<0) /*"alt-tab" skips this win*/ -#define WIN_HINTS_SKIP_WINLIST (1<<1) /*do not show in window list*/ -#define WIN_HINTS_SKIP_TASKBAR (1<<2) /*do not show on taskbar*/ -#define WIN_HINTS_GROUP_TRANSIENT (1<<3) /*Reserved - definition is unclear*/ -#define WIN_HINTS_FOCUS_ON_CLICK (1<<4) /*app only accepts focus if clicked*/ -#define WIN_HINTS_DO_NOT_COVER (1<<5) /* attempt to not cover this window */ - - -#define WIN_STATE_STICKY (1<<0) /*everyone knows sticky*/ -#define WIN_STATE_MINIMIZED (1<<1) /*Reserved - definition is unclear*/ -#define WIN_STATE_MAXIMIZED_VERT (1<<2) /*window in maximized V state*/ -#define WIN_STATE_MAXIMIZED_HORIZ (1<<3) /*window in maximized H state*/ -#define WIN_STATE_HIDDEN (1<<4) /*not on taskbar but window visible*/ -#define WIN_STATE_SHADED (1<<5) /*shaded (MacOS / Afterstep style)*/ -/* these are bogus states defined in "the spec" */ -#define WIN_STATE_HID_WORKSPACE (1<<6) /*not on current desktop*/ -#define WIN_STATE_HID_TRANSIENT (1<<7) /*owner of transient is hidden*/ -#define WIN_STATE_FIXED_POSITION (1<<8) /*window is fixed in position even*/ -#define WIN_STATE_ARRANGE_IGNORE (1<<9) /*ignore for auto arranging*/ - - -#define WIN_LAYER_DESKTOP 0 -#define WIN_LAYER_BELOW 2 -#define WIN_LAYER_NORMAL 4 -#define WIN_LAYER_ONTOP 6 -#define WIN_LAYER_DOCK 8 -#define WIN_LAYER_ABOVE_DOCK 10 -#define WIN_LAYER_MENU 12 - - - -static Atom _XA_WIN_SUPPORTING_WM_CHECK = 0; -static Atom _XA_WIN_PROTOCOLS; -static Atom _XA_WIN_LAYER; -static Atom _XA_WIN_STATE; -static Atom _XA_WIN_HINTS; -static Atom _XA_WIN_APP_STATE; -static Atom _XA_WIN_EXPANDED_SIZE; -static Atom _XA_WIN_ICONS; -static Atom _XA_WIN_WORKSPACE; -static Atom _XA_WIN_WORKSPACE_COUNT; -static Atom _XA_WIN_WORKSPACE_NAMES; -static Atom _XA_WIN_CLIENT_LIST; -static Atom _XA_WIN_DESKTOP_BUTTON_PROXY; - - -static void observer(void *self, WMNotification *notif); -static void wsobserver(void *self, WMNotification *notif); - - -void -wGNOMEInitStuff(WScreen *scr) -{ - Atom supportedStuff[10]; - int count; - - if (!_XA_WIN_SUPPORTING_WM_CHECK) { - - _XA_WIN_SUPPORTING_WM_CHECK = - XInternAtom(dpy, "_WIN_SUPPORTING_WM_CHECK", False); - - _XA_WIN_PROTOCOLS = XInternAtom(dpy, "_WIN_PROTOCOLS", False); - - _XA_WIN_LAYER = XInternAtom(dpy, "_WIN_LAYER", False); - - _XA_WIN_STATE = XInternAtom(dpy, "_WIN_STATE", False); - - _XA_WIN_HINTS = XInternAtom(dpy, "_WIN_HINTS", False); - - _XA_WIN_APP_STATE = XInternAtom(dpy, "_WIN_APP_STATE", False); - - _XA_WIN_EXPANDED_SIZE = XInternAtom(dpy, "_WIN_EXPANDED_SIZE", False); - - _XA_WIN_ICONS = XInternAtom(dpy, "_WIN_ICONS", False); - - _XA_WIN_WORKSPACE = XInternAtom(dpy, "_WIN_WORKSPACE", False); - - _XA_WIN_WORKSPACE_COUNT = - XInternAtom(dpy, "_WIN_WORKSPACE_COUNT", False); - - _XA_WIN_WORKSPACE_NAMES = - XInternAtom(dpy, "_WIN_WORKSPACE_NAMES", False); - - _XA_WIN_CLIENT_LIST = XInternAtom(dpy, "_WIN_CLIENT_LIST", False); - - _XA_WIN_DESKTOP_BUTTON_PROXY = - XInternAtom(dpy, "_WIN_DESKTOP_BUTTON_PROXY", False); - } - - /* I'd rather use the ICCCM 2.0 mechanisms, but - * since some people prefer to reinvent the wheel instead of - * conforming to standards... */ - - /* setup the "We're compliant, you idiot!" hint */ - - /* why XA_CARDINAL instead of XA_WINDOW? */ - XChangeProperty(dpy, scr->root_win, _XA_WIN_SUPPORTING_WM_CHECK, - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&scr->no_focus_win, 1); - - XChangeProperty(dpy, scr->no_focus_win, _XA_WIN_SUPPORTING_WM_CHECK, - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&scr->no_focus_win, 1); - - - /* setup the "desktop button proxy" thing */ - XChangeProperty(dpy, scr->root_win, _XA_WIN_DESKTOP_BUTTON_PROXY, - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&scr->no_focus_win, 1); - XChangeProperty(dpy, scr->no_focus_win, _XA_WIN_DESKTOP_BUTTON_PROXY, - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)&scr->no_focus_win, 1); - - - /* setup the list of supported protocols */ - count = 0; - supportedStuff[count++] = _XA_WIN_LAYER; - supportedStuff[count++] = _XA_WIN_STATE; - supportedStuff[count++] = _XA_WIN_HINTS; - supportedStuff[count++] = _XA_WIN_APP_STATE; - supportedStuff[count++] = _XA_WIN_EXPANDED_SIZE; - supportedStuff[count++] = _XA_WIN_ICONS; - supportedStuff[count++] = _XA_WIN_WORKSPACE; - supportedStuff[count++] = _XA_WIN_WORKSPACE_COUNT; - supportedStuff[count++] = _XA_WIN_WORKSPACE_NAMES; - supportedStuff[count++] = _XA_WIN_CLIENT_LIST; - - XChangeProperty(dpy, scr->root_win, _XA_WIN_PROTOCOLS, XA_ATOM, 32, - PropModeReplace, (unsigned char*)supportedStuff, count); - - XFlush(dpy); - - WMAddNotificationObserver(observer, NULL, WMNManaged, NULL); - WMAddNotificationObserver(observer, NULL, WMNUnmanaged, NULL); - WMAddNotificationObserver(observer, NULL, WMNChangedWorkspace, NULL); - WMAddNotificationObserver(observer, NULL, WMNChangedState, NULL); - WMAddNotificationObserver(observer, NULL, WMNChangedFocus, NULL); - WMAddNotificationObserver(observer, NULL, WMNChangedStacking, NULL); - WMAddNotificationObserver(observer, NULL, WMNChangedName, NULL); - - WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceCreated, NULL); - WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceDestroyed, NULL); - WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceChanged, NULL); - WMAddNotificationObserver(wsobserver, NULL, WMNWorkspaceNameChanged, NULL); -} - - -void -wGNOMEUpdateClientListHint(WScreen *scr) -{ - WWindow *wwin; - Window *windows; - int count; - - windows = malloc(sizeof(Window)*scr->window_count); - if (!windows) { - wwarning(_("out of memory while updating GNOME hints")); - return; - } - - count = 0; - wwin = scr->focused_window; - while (wwin) { - if (!wwin->flags.internal_window && - !wwin->client_flags.skip_window_list) { - - windows[count++] = wwin->client_win; - } - - wwin = wwin->prev; - } - - XChangeProperty(dpy, scr->root_win, _XA_WIN_CLIENT_LIST, XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)windows, count); - - wfree(windows); - XFlush(dpy); -} - - -void -wGNOMEUpdateWorkspaceHints(WScreen *scr) -{ - long val; - - val = scr->workspace_count; - - XChangeProperty(dpy, scr->root_win, _XA_WIN_WORKSPACE_COUNT, XA_CARDINAL, - 32, PropModeReplace, (unsigned char*)&val, 1); - - wGNOMEUpdateWorkspaceNamesHint(scr); -} - - -void -wGNOMEUpdateWorkspaceNamesHint(WScreen *scr) -{ - char *wsNames[MAX_WORKSPACES]; - XTextProperty textProp; - int i; - - for (i = 0; i < scr->workspace_count; i++) { - wsNames[i] = scr->workspaces[i]->name; - } - - if (XStringListToTextProperty(wsNames, scr->workspace_count, &textProp)) { - XSetTextProperty(dpy, scr->root_win, &textProp, - _XA_WIN_WORKSPACE_NAMES); - XFree(textProp.value); - } -} - - -void -wGNOMEUpdateCurrentWorkspaceHint(WScreen *scr) -{ - long val; - - val = scr->current_workspace; - - XChangeProperty(dpy, scr->root_win, _XA_WIN_WORKSPACE, XA_CARDINAL, - 32, PropModeReplace, (unsigned char*)&val, 1); -} - - -static int -getWindowLevel(int layer) -{ - int level; - - if (layer <= WIN_LAYER_DESKTOP) - level = WMDesktopLevel; - else if (layer <= WIN_LAYER_BELOW) - level = WMSunkenLevel; - else if (layer <= WIN_LAYER_NORMAL) - level = WMNormalLevel; - else if (layer <= WIN_LAYER_ONTOP) - level = WMFloatingLevel; - else if (layer <= WIN_LAYER_DOCK) - level = WMDockLevel; - else if (layer <= WIN_LAYER_ABOVE_DOCK) - level = WMSubmenuLevel; - else if (layer <= WIN_LAYER_MENU) - level = WMMainMenuLevel; - else - level = WMOuterSpaceLevel; - - return level; -} - - -Bool -wGNOMECheckClientHints(WWindow *wwin, int *layer, int *workspace) -{ - Atom type_ret; - int fmt_ret; - unsigned long nitems_ret; - unsigned long bytes_after_ret; - long flags, val, *data = 0; - Bool hasHints = False; - - /* hints */ - - if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_HINTS, 0, 1, False, - /* should be XA_INTEGER, but spec is broken */ - XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret, - &bytes_after_ret, - (unsigned char**)&data)==Success && data) { - flags = *data; - - XFree(data); - - if (flags & (WIN_HINTS_SKIP_FOCUS|WIN_HINTS_SKIP_WINLIST - |WIN_HINTS_SKIP_TASKBAR)) { - wwin->client_flags.skip_window_list = 1; - } - - /* client reserved area, for the panel */ - if (flags & (WIN_HINTS_DO_NOT_COVER)) { - WReservedArea *area; - - area = malloc(sizeof(WReservedArea)); - if (!area) { - wwarning(_("out of memory while updating GNOME hints")); - } else { - XWindowAttributes wattribs; - - XGetWindowAttributes(dpy, wwin->client_win, &wattribs); - wClientGetNormalHints(wwin, &wattribs, False, - &area->area.x1, &area->area.y1, - &area->area.x2, &area->area.y2); - area->area.x2 = area->area.x2 + area->area.x1; - area->area.y2 = area->area.y2 + area->area.y1; - - area->window = wwin->client_win; - } - area->next = wwin->screen_ptr->reservedAreas; - wwin->screen_ptr->reservedAreas = area; - - wScreenUpdateUsableArea(wwin->screen_ptr); - } - - hasHints = True; - } - - /* layer */ - if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_LAYER, 0, 1, False, - XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret, - &bytes_after_ret, - (unsigned char**)&data)==Success && data) { - val = *data; - - XFree(data); - - *layer = getWindowLevel(val); - hasHints = True; - } - - /* workspace */ - if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_WORKSPACE, 0, 1, - False, XA_CARDINAL, &type_ret, &fmt_ret, - &nitems_ret, &bytes_after_ret, - (unsigned char**)&data)==Success && data) { - val = *data; - - XFree(data); - - if (val > 0) - *workspace = val; - hasHints = True; - } - - /* reserved area */ - if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_EXPANDED_SIZE, 0, 1, - False, XA_CARDINAL, &type_ret, &fmt_ret, - &nitems_ret, &bytes_after_ret, - (unsigned char**)&data)==Success && data) { - WReservedArea *area; - - area = malloc(sizeof(WReservedArea)); - if (!area) { - wwarning(_("out of memory while updating GNOME hints")); - } else { - area->area.x1 = data[0]; - area->area.y1 = data[1]; - area->area.x2 = data[2] - data[0]; - area->area.y2 = data[3] - data[1]; - XFree(data); - - area->window = wwin->client_win; - } - - area->next = wwin->screen_ptr->reservedAreas; - wwin->screen_ptr->reservedAreas = area; - - wScreenUpdateUsableArea(wwin->screen_ptr); - hasHints = True; - } - - return hasHints; -} - - -Bool -wGNOMEGetUsableArea(WScreen *scr, int head, WArea *area) -{ - WReservedArea *cur; - WMRect rect; - - if(!scr->reservedAreas) - return False; - - area->x1 = area->y1 = area->x2 = area->y2 = 0; - - for(cur = scr->reservedAreas ; cur ; cur = cur->next) { - WWindow * wwin = wWindowFor(cur->window); - if (wWindowTouchesHead(wwin, head)) { - if(cur->area.x1 > area->x1) - area->x1 = cur->area.x1; - if(cur->area.y1 > area->y1) - area->y1 = cur->area.y1; - if(cur->area.x2 > area->x2) - area->x2 = cur->area.x2; - if(cur->area.y2 > area->y2) - area->y2 = cur->area.y2; - } - } - - if (area->x1==0 && area->x2==0 && - area->y1==0 && area->y2==0) return False; - - rect = wGetRectForHead(scr, head); - - area->x1 = rect.pos.x + area->x1; - area->x2 = rect.pos.x + rect.size.width - area->x2; - area->y1 = rect.pos.y + area->y1; - area->y2 = rect.pos.y + rect.size.height - area->y2; - - return True; -} - - -Bool -wGNOMECheckInitialClientState(WWindow *wwin) -{ - Atom type_ret; - int fmt_ret; - unsigned long nitems_ret; - unsigned long bytes_after_ret; - long flags, *data = 0; - - if (XGetWindowProperty(dpy, wwin->client_win, _XA_WIN_STATE, 0, 1, False, - XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret, - &bytes_after_ret, - (unsigned char**)&data)!=Success || !data) - return False; - - flags = *data; - - XFree(data); - - if (flags & WIN_STATE_STICKY) - wwin->client_flags.omnipresent = 1; - - if (flags & (WIN_STATE_MAXIMIZED_VERT|WIN_STATE_MAXIMIZED_HORIZ)) { - - if (flags & WIN_STATE_MAXIMIZED_VERT) - wwin->flags.maximized |= MAX_VERTICAL; - - if (flags & WIN_STATE_MAXIMIZED_HORIZ) - wwin->flags.maximized |= MAX_HORIZONTAL; - } - - if (flags & WIN_STATE_SHADED) - wwin->flags.shaded = 1; - - return True; -} - - -void -wGNOMEUpdateClientStateHint(WWindow *wwin, Bool changedWorkspace) -{ - long val; - long flags = 0; - - if (changedWorkspace) { - val = wwin->frame->workspace; - - XChangeProperty(dpy, wwin->client_win, _XA_WIN_WORKSPACE, XA_CARDINAL, - 32, PropModeReplace, (unsigned char*)&val, 1); - - if (val != wwin->screen_ptr->current_workspace) - flags |= WIN_STATE_HID_WORKSPACE; - } - - if (IS_OMNIPRESENT(wwin)) - flags |= WIN_STATE_STICKY; - - if (wwin->flags.miniaturized) - flags |= WIN_STATE_MINIMIZED; - - if (wwin->flags.maximized & MAX_VERTICAL) - flags |= WIN_STATE_MAXIMIZED_VERT; - - if (wwin->flags.maximized & MAX_HORIZONTAL) - flags |= WIN_STATE_MAXIMIZED_HORIZ; - - if (wwin->flags.shaded) - flags |= WIN_STATE_SHADED; - - if (wwin->transient_for != None) { - WWindow *owner = wWindowFor(wwin->transient_for); - - if (owner && !owner->flags.mapped) - flags |= WIN_STATE_HID_TRANSIENT; - } - - /* ? */ - if (wwin->flags.hidden) - flags |= WIN_STATE_HIDDEN; - - XChangeProperty(dpy, wwin->client_win, _XA_WIN_STATE, XA_CARDINAL, - 32, PropModeReplace, (unsigned char*)&flags, 1); -} - - -Bool -wGNOMEProcessClientMessage(XClientMessageEvent *event) -{ - WScreen *scr; - WWindow *wwin; - Bool done = True; - - scr = wScreenForWindow(event->window); - if (scr) { - /* generic client messages */ - if (event->message_type == _XA_WIN_WORKSPACE) { - wWorkspaceChange(scr, event->data.l[0]); - } else { - done = False; - } - - if (done) - return True; - } - - /* window specific client messages */ - - wwin = wWindowFor(event->window); - if (!wwin) - return False; - - if (event->message_type == _XA_WIN_LAYER) { - int level = getWindowLevel(event->data.l[0]); - - if (WINDOW_LEVEL(wwin) != level) { - ChangeStackingLevel(wwin->frame->core, level); - } - } else if (event->message_type == _XA_WIN_STATE) { - int flags, mask; - int maximize = 0; - - mask = event->data.l[0]; - flags = event->data.l[1]; - - if (mask & WIN_STATE_STICKY) { - if ((flags & WIN_STATE_STICKY) != WFLAGP(wwin, omnipresent)) { - wWindowSetOmnipresent(wwin, (flags & WIN_STATE_STICKY)!=0); - } - } - - if (mask & WIN_STATE_MAXIMIZED_VERT) { - if (flags & WIN_STATE_MAXIMIZED_VERT) - maximize = MAX_VERTICAL; - else - maximize = 0; - } else { - maximize = wwin->flags.maximized & MAX_VERTICAL; - } - - if (mask & WIN_STATE_MAXIMIZED_HORIZ) { - if (flags & WIN_STATE_MAXIMIZED_HORIZ) - maximize |= MAX_HORIZONTAL; - else - maximize |= 0; - } else { - maximize |= wwin->flags.maximized & MAX_HORIZONTAL; - } - - if (maximize != wwin->flags.maximized) { - if (maximize) { - wMaximizeWindow(wwin, maximize); - } else { - wUnmaximizeWindow(wwin); - } - } - - if (mask & WIN_STATE_SHADED) { - if ((flags & WIN_STATE_SHADED) != wwin->flags.shaded) { - if (wwin->flags.shaded) - wUnshadeWindow(wwin); - else - wShadeWindow(wwin); - } - } - } else if (event->message_type == _XA_WIN_WORKSPACE) { - - if (event->data.l[0] != wwin->frame->workspace) { - wWindowChangeWorkspace(wwin, event->data.l[0]); - } - } else { - done = False; - } - - return done; -} - - -Bool -wGNOMEProxyizeButtonEvent(WScreen *scr, XEvent *event) -{ - if (event->type == ButtonPress) - XUngrabPointer(dpy, CurrentTime); - XSendEvent(dpy, scr->no_focus_win, False, SubstructureNotifyMask, event); - - return True; -} - - -void -wGNOMERemoveClient(WWindow *wwin) -{ - int flag = 0; - WReservedArea *area; - - wGNOMEUpdateClientListHint(wwin->screen_ptr); - - area = wwin->screen_ptr->reservedAreas; - - if (area) { - if (area->window == wwin->client_win) { - wwin->screen_ptr->reservedAreas = area->next; - wfree(area); - flag = 1; - } else { - while (area->next && area->next->window != wwin->client_win) - area = area->next; - - if (area->next) { - WReservedArea *next; - - next = area->next->next; - wfree(area->next); - area->next = next; - - flag = 1; - } - } - } - - if (flag) { - wScreenUpdateUsableArea(wwin->screen_ptr); - } -} - - - - -static void -observer(void *self, WMNotification *notif) -{ - WWindow *wwin = (WWindow*)WMGetNotificationObject(notif); - const char *name = WMGetNotificationName(notif); - - if (strcmp(name, WMNManaged) == 0 && wwin) { - wGNOMEUpdateClientStateHint(wwin, True); - - wGNOMEUpdateClientListHint(wwin->screen_ptr); - } else if (strcmp(name, WMNUnmanaged) == 0 && wwin) { - wGNOMERemoveClient(wwin); - } else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin) { - wGNOMEUpdateClientStateHint(wwin, True); - } else if (strcmp(name, WMNChangedState) == 0 && wwin) { - wGNOMEUpdateClientStateHint(wwin, False); - } -} - - -static void -wsobserver(void *self, WMNotification *notif) -{ - WScreen *scr = (WScreen*)WMGetNotificationObject(notif); - const char *name = WMGetNotificationName(notif); - - if (strcmp(name, WMNWorkspaceCreated) == 0) { - wGNOMEUpdateWorkspaceHints(scr); - } else if (strcmp(name, WMNWorkspaceDestroyed) == 0) { - wGNOMEUpdateWorkspaceHints(scr); - } else if (strcmp(name, WMNWorkspaceNameChanged) == 0) { - wGNOMEUpdateWorkspaceNamesHint(scr); - } else if (strcmp(name, WMNWorkspaceChanged) == 0) { - wGNOMEUpdateCurrentWorkspaceHint(scr); - } else if (strcmp(name, WMNResetStacking) == 0) { - - } -} - - -#endif /* GNOME_STUFF */ - diff --git a/src/gnome.h b/src/gnome.h deleted file mode 100644 index e681625c..00000000 --- a/src/gnome.h +++ /dev/null @@ -1,53 +0,0 @@ -/* gnome.h-- stuff for support for gnome hints - * - * Window Maker window manager - * - * Copyright (c) 1998-2003 Alfredo K. Kojima - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - - -#ifndef _GNOME_H_ -#define _GNOME_H_ - - -void wGNOMEInitStuff(WScreen *scr); - -void wGNOMEUpdateClientListHint(WScreen *scr); - -void wGNOMEUpdateWorkspaceHints(WScreen *scr); - -void wGNOMEUpdateCurrentWorkspaceHint(WScreen *scr); - -void wGNOMEUpdateWorkspaceNamesHint(WScreen *scr); - -Bool wGNOMECheckClientHints(WWindow *wwin, int *layer, int *workspace); - -void wGNOMEUpdateClientStateHint(WWindow *wwin, Bool changedWorkspace); - -Bool wGNOMEProcessClientMessage(XClientMessageEvent *event); - -void wGNOMERemoveClient(WWindow *wwin); - -Bool wGNOMECheckInitialClientState(WWindow *wwin); - -Bool wGNOMEProxyizeButtonEvent(WScreen *scr, XEvent *event); - -Bool wGNOMEGetUsableArea(WScreen *scr, int head, WArea *area); - -#endif - diff --git a/src/kwm.c b/src/kwm.c deleted file mode 100644 index 8490349e..00000000 --- a/src/kwm.c +++ /dev/null @@ -1,1955 +0,0 @@ -/* kwm.c-- stuff for support for kwm hints - * - * Window Maker window manager - * - * Copyright (c) 1998-2003 Alfredo K. Kojima - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -/* - * - * Supported stuff: - * ================ - * - * kfm icon selection from krootbgwm - * - * kwm.h function/method Notes - *---------------------------------------------------------------------------- - * setUnsavedDataHint() currently, only gives visual clue that - * there is unsaved data (broken X close button) - * setSticky() - * setIcon() std X thing... - * setDecoration() - * logout() - * refreshScreen() - * setWmCommand() std X thing - * currentDesktop() - * setKWMModule() - * - * isKWMInitialized() not trustworthy - * activeWindow() dunno it's use, but since it's easy to - * implement it won't hurt to support - * switchToDesktop() - * (set/get)WindowRegion() - * (set)numberOfDesktops() KDE limits to 32, but wmaker is virtually - * unlimited. May raise some incompatibility - * in badly written KDE modules? - * (set/get)DesktopName() - * sendKWMCommand() also does the message relay thing - * desktop() - * geometryRestore() - * isIconified() - * isMaximized() - * isSticky() - * moveToDesktop() WARNING: evil mechanism - * setGeometryRestore() WARNING: evil mechanism - * setMaximize() woo hoo! wanna race? - * setIconify() BAH!: why reinvent the f'ing wheel!? - * its even broken!!! - * move() std X thing - * setGeometry() std X thing - * close() std X thing - * activate() - * activateInternal() - * raise() std X thing - * lower() std X thing - * prepareForSwallowing() std X thing - * doNotManage() klugy thing... - * getBlablablaString() - * setKWMDockModule() maybe we can make the Dock behave as the KDE - * dock, but must figure where to show the windows - * setDockWindow() - * - * Unsupported stuff (superfluous/not-essential/nonsense): - * ======================================================= - * - * darkenScreen() - * setMiniIcon() - * configureWm() - * raiseSoundEvent() - * registerSoundEvent() - * unregisterSoundEvent() - * title() - * titleWithState() - * geometry() kde lib code makes it unnecessary - * - * - * Extensions to KDE: - * ================== - * - * These are clientmessage-type messages specific to Window Maker: - * wmaker:info - show info panel - * wmaker:legal - show legal panel - * wmaker:arrangeIcons - arrange icons - * wmaker:showAll - show all windows - * wmaker:hideOthers - hide others - * wmaker:restart - restart wmaker - * wmaker:exit - exit wmaker - */ - -/* - * XXX - * different WORKAREA for each workspace - * -- done by rebuilding usableArea at each workspace switch. - */ - - -#include "wconfig.h" - -#ifdef KWM_HINTS - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - - -#include "WindowMaker.h" - -#include "screen.h" -#include "wcore.h" -#include "framewin.h" -#include "window.h" -#include "properties.h" -#include "icon.h" -#include "client.h" -#include "funcs.h" -#include "actions.h" -#include "workspace.h" -#include "dialog.h" -#include "stacking.h" -#include "xinerama.h" - -#include "kwm.h" - -/*#define DEBUG1 - */ -/******* Global ******/ - -extern Time LastFocusChange; -extern Time LastTimestamp; - - -extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW; -extern Atom _XA_WM_DELETE_WINDOW; - -/** Local **/ - -static Atom _XA_KWM_COMMAND = 0; -static Atom _XA_KWM_ACTIVATE_WINDOW = 0; -static Atom _XA_KWM_ACTIVE_WINDOW = 0; -static Atom _XA_KWM_DO_NOT_MANAGE = 0; -static Atom _XA_KWM_DOCKWINDOW = 0; -static Atom _XA_KWM_RUNNING = 0; - -static Atom _XA_KWM_MODULE = 0; - -static Atom _XA_KWM_MODULE_INIT = 0; -static Atom _XA_KWM_MODULE_INITIALIZED = 0; -static Atom _XA_KWM_MODULE_DESKTOP_CHANGE = 0; -static Atom _XA_KWM_MODULE_DESKTOP_NAME_CHANGE = 0; -static Atom _XA_KWM_MODULE_DESKTOP_NUMBER_CHANGE = 0; -static Atom _XA_KWM_MODULE_WIN_ADD = 0; -static Atom _XA_KWM_MODULE_WIN_REMOVE = 0; -static Atom _XA_KWM_MODULE_WIN_CHANGE = 0; -static Atom _XA_KWM_MODULE_WIN_RAISE = 0; -static Atom _XA_KWM_MODULE_WIN_LOWER = 0; -static Atom _XA_KWM_MODULE_WIN_ACTIVATE = 0; -static Atom _XA_KWM_MODULE_WIN_ICON_CHANGE = 0; -static Atom _XA_KWM_MODULE_DOCKWIN_ADD = 0; -static Atom _XA_KWM_MODULE_DOCKWIN_REMOVE = 0; - -static Atom _XA_KWM_WIN_UNSAVED_DATA = 0; -static Atom _XA_KWM_WIN_DECORATION = 0; -static Atom _XA_KWM_WIN_DESKTOP = 0; -static Atom _XA_KWM_WIN_GEOMETRY_RESTORE = 0; -static Atom _XA_KWM_WIN_ICONIFIED = 0; -static Atom _XA_KWM_WIN_MAXIMIZED = 0; -static Atom _XA_KWM_WIN_STICKY = 0; - -static Atom _XA_KWM_WIN_ICON_GEOMETRY = 0; - -static Atom _XA_KWM_CURRENT_DESKTOP = 0; -static Atom _XA_KWM_NUMBER_OF_DESKTOPS = 0; -static Atom _XA_KWM_DESKTOP_NAME_[MAX_WORKSPACES]; -static Atom _XA_KWM_WINDOW_REGION_[MAX_WORKSPACES]; - - - -/* list of window titles that must not be managed */ -typedef struct KWMDoNotManageList { - char title[20]; - struct KWMDoNotManageList *next; -} KWMDoNotManageList; - -static KWMDoNotManageList *KWMDoNotManageCrap = NULL; - - -/* list of KWM modules */ -typedef struct KWMModuleList { - Window window; - struct KWMModuleList *next; -#ifdef DEBUG1 - char *title; -#endif -} KWMModuleList; - -static KWMModuleList *KWMModules = NULL; - -static KWMModuleList *KWMDockWindows = NULL; - -/* window decoration types */ -enum { - KWMnoDecoration = 0, - KWMnormalDecoration = 1, - KWMtinyDecoration = 2, - KWMnoFocus = 256, - KWMstandaloneMenuBar = 512, - KWMdesktopIcon = 1024, - KWMstaysOnTop = 2048 -}; - - - -static void observer(void *self, WMNotification *notif); -static void wsobserver(void *self, WMNotification *notif); - - - -static Bool -getSimpleHint(Window win, Atom atom, long *retval) -{ - long *data = 0; - - assert(atom!=0); - - data = (long*)PropGetCheckProperty(win, atom, atom, 32, 1, NULL); - - if (!data) - return False; - - *retval = *data; - - XFree(data); - - return True; -} - - - -static void -setSimpleHint(Window win, Atom atom, long value) -{ - assert(atom!=0); - XChangeProperty(dpy, win, atom, atom, - 32, PropModeReplace, (unsigned char*)&value, 1); -} - - -static void -sendClientMessage(WScreen *scr, Window window, Atom atom, long value) -{ - XEvent event; - long mask = 0; - - assert(atom!=0); - - memset(&event, 0, sizeof(XEvent)); - event.xclient.type = ClientMessage; - event.xclient.message_type = atom; - event.xclient.window = window; - event.xclient.format = 32; - event.xclient.data.l[0] = value; - event.xclient.data.l[1] = LastTimestamp; - - if (scr && scr->root_win == window) - mask = SubstructureRedirectMask; - - XSendEvent(dpy, window, False, mask, &event); -} - - -static void -sendTextMessage(WScreen *scr, Window window, Atom atom, char *text) -{ - XEvent event; - long mask = 0; - int i; - - assert(atom!=0); - - memset(&event, 0, sizeof(XEvent)); - event.xclient.type = ClientMessage; - event.xclient.message_type = atom; - event.xclient.window = window; - event.xclient.format = 8; - - for (i=0; i<20 && text[i]; i++) - event.xclient.data.b[i] = text[i]; - - if (scr && scr->root_win == window) - mask = SubstructureRedirectMask; - - XSendEvent(dpy, window, False, mask, &event); -} - - -static Bool -getAreaHint(Window win, Atom atom, WArea *area) -{ - long *data = 0; - - data = (long*)PropGetCheckProperty(win, atom, atom, 32, 4, NULL); - - if (!data) - return False; - - area->x1 = data[0]; - area->y1 = data[1]; - area->x2 = data[2] + area->x1; - area->y2 = data[3] + area->y1; - - XFree(data); - - return True; -} - - -static void -setAreaHint(Window win, Atom atom, WArea area) -{ - long value[4]; - - assert(atom!=0); - value[0] = area.x1; - value[1] = area.y1; - value[2] = area.x2 - area.x1; - value[3] = area.y2 - area.y1; - XChangeProperty(dpy, win, atom, atom, 32, PropModeReplace, - (unsigned char*)&value, 4); -} - - -static void -addModule(WScreen *scr, Window window) -{ - KWMModuleList *node; - long val; - WWindow *ptr; - - node = malloc(sizeof(KWMModuleList)); - if (!node) { - wwarning("out of memory while registering KDE module"); - return; - } - - node->next = KWMModules; - node->window = window; - KWMModules = node; - - sendClientMessage(scr, window, _XA_KWM_MODULE_INIT, 0); - - if (getSimpleHint(window, _XA_KWM_MODULE, &val) && val==2) { - if (scr->kwm_dock != None) { - setSimpleHint(window, _XA_KWM_MODULE, 1); - } else { - KWMModuleList *ptr; - - scr->kwm_dock = window; - - for (ptr = KWMDockWindows; ptr!=NULL; ptr = ptr->next) { - sendClientMessage(scr, scr->kwm_dock, _XA_KWM_MODULE_DOCKWIN_ADD, - ptr->window); - } - } - } - - /* send list of windows */ - for (ptr = scr->focused_window; ptr!=NULL; ptr = ptr->prev) { - if (!ptr->flags.kwm_hidden_for_modules - && !WFLAGP(ptr, skip_window_list)) { - sendClientMessage(scr, window, _XA_KWM_MODULE_WIN_ADD, - ptr->client_win); - } - } - - /* send window stacking order */ - wKWMSendStacking(scr, window); - - /* send focused window */ - if (scr->focused_window && scr->focused_window->flags.focused) { - sendClientMessage(scr, window, _XA_KWM_MODULE_WIN_ACTIVATE, - scr->focused_window->client_win); - } - - /* tell who we are */ - sendTextMessage(scr, window, _XA_KWM_COMMAND, "wm:wmaker"); - - - sendClientMessage(scr, window, _XA_KWM_MODULE_INITIALIZED, 0); -#ifdef DEBUG1 - KWMModules->title = NULL; - XFetchName(dpy, window, &KWMModules->title); - printf("NEW MODULE %s\n", KWMModules->title); -#endif -} - - -static void -removeModule(WScreen *scr, Window window) -{ - KWMModuleList *next; - - if (!KWMModules) { - return; - } - - if (KWMModules->window == window) { - next = KWMModules->next; -#ifdef DEBUG1 - printf("REMOVING MODULE %s\n", KWMModules->title); - if (KWMModules->title) - XFree(KWMModules->title); -#endif - wfree(KWMModules); - KWMModules = next; - } else { - KWMModuleList *ptr; - - ptr = KWMModules; - while (ptr->next) { - if (ptr->next->window == window) { - next = ptr->next->next; -#ifdef DEBUG1 - printf("REMOVING MODULE %s\n", ptr->next->title); - if (ptr->next->title) - XFree(ptr->next->title); -#endif - wfree(ptr->next); - ptr->next->next = next; - break; - } - ptr->next = ptr->next->next; - } - } - - if (scr->kwm_dock == window) - scr->kwm_dock = None; -} - - - -static void -addDockWindow(WScreen *scr, Window window) -{ - KWMModuleList *ptr; - - for (ptr = KWMDockWindows; ptr != NULL; ptr = ptr->next) { - if (ptr->window == window) - break; - } - if (!ptr) { - KWMModuleList *node; - - node = malloc(sizeof(KWMModuleList)); - if (!node) { - wwarning("out of memory while processing KDE dock window"); - return; - } - node->next = KWMDockWindows; - KWMDockWindows = node; - node->window = window; - XSelectInput(dpy, window, StructureNotifyMask); - - sendClientMessage(scr, scr->kwm_dock, _XA_KWM_MODULE_DOCKWIN_ADD, - window); - } -} - - -static void -removeDockWindow(WScreen *scr, Window window) -{ - if (!KWMDockWindows) - return; - - if (KWMDockWindows->window == window) { - KWMModuleList *next; - - sendClientMessage(scr, scr->kwm_dock, _XA_KWM_MODULE_DOCKWIN_REMOVE, - window); - - next = KWMDockWindows->next; - wfree(KWMDockWindows); - KWMDockWindows = next; - - } else { - KWMModuleList *ptr, *next; - - ptr = KWMDockWindows; - while (ptr->next) { - if (ptr->next->window == window) { - sendClientMessage(scr, scr->kwm_dock, - _XA_KWM_MODULE_DOCKWIN_REMOVE, window); - next = ptr->next->next; - wfree(ptr->next); - ptr->next = next; - return; - } - ptr = ptr->next; - } - } -} - - -static void -sendToModules(WScreen *scr, Atom atom, WWindow *wwin, long data) -{ - KWMModuleList *ptr; - XEvent event; - long mask; - - if (wwin) { - if (wwin->flags.kwm_hidden_for_modules - || WFLAGP(wwin, skip_window_list)) - return; - data = wwin->client_win; - } -#ifdef DEBUG1 - printf("notifying %s\n",XGetAtomName(dpy, atom)); -#endif - memset(&event, 0, sizeof(XEvent)); - event.xclient.type = ClientMessage; - event.xclient.message_type = atom; - event.xclient.format = 32; - event.xclient.data.l[1] = LastTimestamp; - - mask = 0; - if (scr && scr->root_win == data) - mask = SubstructureRedirectMask; - - for (ptr = KWMModules; ptr!=NULL; ptr = ptr->next) { - event.xclient.window = ptr->window; - event.xclient.data.l[0] = data; - XSendEvent(dpy, ptr->window, False, mask, &event); - } -} - - -void -wKWMInitStuff(WScreen *scr) -{ - if (!_XA_KWM_WIN_STICKY) { - _XA_KWM_WIN_UNSAVED_DATA = XInternAtom(dpy, "KWM_WIN_UNSAVED_DATA", - False); - - _XA_KWM_WIN_DECORATION = XInternAtom(dpy, "KWM_WIN_DECORATION", False); - - _XA_KWM_WIN_DESKTOP = XInternAtom(dpy, "KWM_WIN_DESKTOP", False); - - _XA_KWM_WIN_GEOMETRY_RESTORE = XInternAtom(dpy, - "KWM_WIN_GEOMETRY_RESTORE", - False); - - _XA_KWM_WIN_STICKY = XInternAtom(dpy, "KWM_WIN_STICKY", False); - - _XA_KWM_WIN_ICONIFIED = XInternAtom(dpy, "KWM_WIN_ICONIFIED", False); - - _XA_KWM_WIN_MAXIMIZED = XInternAtom(dpy, "KWM_WIN_MAXIMIZED", False); - - _XA_KWM_WIN_ICON_GEOMETRY = XInternAtom(dpy, "KWM_WIN_ICON_GEOMETRY", - False); - - _XA_KWM_COMMAND = XInternAtom(dpy, "KWM_COMMAND", False); - - _XA_KWM_ACTIVE_WINDOW = XInternAtom(dpy, "KWM_ACTIVE_WINDOW", False); - - _XA_KWM_ACTIVATE_WINDOW = XInternAtom(dpy, "KWM_ACTIVATE_WINDOW", - False); - - _XA_KWM_DO_NOT_MANAGE = XInternAtom(dpy, "KWM_DO_NOT_MANAGE", False); - - _XA_KWM_CURRENT_DESKTOP = XInternAtom(dpy, "KWM_CURRENT_DESKTOP", - False); - - _XA_KWM_NUMBER_OF_DESKTOPS = XInternAtom(dpy, "KWM_NUMBER_OF_DESKTOPS", - False); - - _XA_KWM_DOCKWINDOW = XInternAtom(dpy, "KWM_DOCKWINDOW", False); - - _XA_KWM_RUNNING = XInternAtom(dpy, "KWM_RUNNING", False); - - _XA_KWM_MODULE = XInternAtom(dpy, "KWM_MODULE", False); - - _XA_KWM_MODULE_INIT = XInternAtom(dpy, "KWM_MODULE_INIT", False); - _XA_KWM_MODULE_INITIALIZED = XInternAtom(dpy, "KWM_MODULE_INITIALIZED", False); - - /* dunno what these do, but Matthias' patch contains it... */ - _XA_KWM_MODULE_DESKTOP_CHANGE = XInternAtom(dpy, "KWM_MODULE_DESKTOP_CHANGE", False); - _XA_KWM_MODULE_DESKTOP_NAME_CHANGE = XInternAtom(dpy, "KWM_MODULE_DESKTOP_NAME_CHANGE", False); - _XA_KWM_MODULE_DESKTOP_NUMBER_CHANGE = XInternAtom(dpy, "KWM_MODULE_DESKTOP_NUMBER_CHANGE", False); - - _XA_KWM_MODULE_WIN_ADD = XInternAtom(dpy, "KWM_MODULE_WIN_ADD", False); - _XA_KWM_MODULE_WIN_REMOVE = XInternAtom(dpy, "KWM_MODULE_WIN_REMOVE", False); - _XA_KWM_MODULE_WIN_CHANGE = XInternAtom(dpy, "KWM_MODULE_WIN_CHANGE", False); - _XA_KWM_MODULE_WIN_RAISE = XInternAtom(dpy, "KWM_MODULE_WIN_RAISE", False); - _XA_KWM_MODULE_WIN_LOWER = XInternAtom(dpy, "KWM_MODULE_WIN_LOWER", False); - _XA_KWM_MODULE_WIN_ACTIVATE = XInternAtom(dpy, "KWM_MODULE_WIN_ACTIVATE", False); - _XA_KWM_MODULE_WIN_ICON_CHANGE = XInternAtom(dpy, "KWM_MODULE_WIN_ICON_CHANGE", False); - _XA_KWM_MODULE_DOCKWIN_ADD = XInternAtom(dpy, "KWM_MODULE_DOCKWIN_ADD", False); - _XA_KWM_MODULE_DOCKWIN_REMOVE = XInternAtom(dpy, "KWM_MODULE_DOCKWIN_REMOVE", False); - - memset(_XA_KWM_WINDOW_REGION_, 0, sizeof(_XA_KWM_WINDOW_REGION_)); - - memset(_XA_KWM_DESKTOP_NAME_, 0, sizeof(_XA_KWM_DESKTOP_NAME_)); - } - -#define SETSTR(hint, str) {\ - static Atom a = 0; if (!a) a = XInternAtom(dpy, #hint, False);\ - XChangeProperty(dpy, scr->root_win, a, XA_STRING, 8, PropModeReplace,\ - (unsigned char*)str, strlen(str));} - - SETSTR(KWM_STRING_MAXIMIZE, _("Maximize")); - SETSTR(KWM_STRING_UNMAXIMIZE, _("Unmaximize")); - SETSTR(KWM_STRING_ICONIFY, _("Miniaturize")); - SETSTR(KWM_STRING_UNICONIFY, _("Deminiaturize")); - SETSTR(KWM_STRING_STICKY, _("Omnipresent")); - SETSTR(KWM_STRING_UNSTICKY, _("Not Omnipresent")); - SETSTR(KWM_STRING_STRING_MOVE, _("Move")); - SETSTR(KWM_STRING_STRING_RESIZE, _("Resize")); - SETSTR(KWM_STRING_CLOSE, _("Close")); - SETSTR(KWM_STRING_TODESKTOP, _("Move To")); - SETSTR(KWM_STRING_ONTOCURRENTDESKTOP, _("Bring Here")); -#undef SETSTR - - /* catch any notifications from any objects */ - - WMAddNotificationObserver(observer, scr, WMNManaged, NULL); - WMAddNotificationObserver(observer, scr, WMNUnmanaged, NULL); - WMAddNotificationObserver(observer, scr, WMNChangedWorkspace, NULL); - WMAddNotificationObserver(observer, scr, WMNChangedState, NULL); - WMAddNotificationObserver(observer, scr, WMNChangedFocus, NULL); - WMAddNotificationObserver(observer, scr, WMNChangedStacking, NULL); - WMAddNotificationObserver(observer, scr, WMNChangedName, NULL); - - WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceCreated, NULL); - WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceDestroyed, NULL); - WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceChanged, NULL); - WMAddNotificationObserver(wsobserver, scr, WMNWorkspaceNameChanged, NULL); - - WMAddNotificationObserver(wsobserver, scr, WMNResetStacking, NULL); -} - - -void -wKWMSendStacking(WScreen *scr, Window module) -{ - WMBagIterator i; - WCoreWindow *core; - - WM_ITERATE_BAG(scr->stacking_list, core, i) { - for (; core != NULL; core = core->stacking->under) { - WWindow *wwin; - - wwin = wWindowFor(core->window); - if (wwin) - sendClientMessage(scr, module, _XA_KWM_MODULE_WIN_RAISE, - wwin->client_win); - } - } -} - - -void -wKWMBroadcastStacking(WScreen *scr) -{ - KWMModuleList *ptr = KWMModules; - - while (ptr) { - wKWMSendStacking(scr, ptr->window); - - ptr = ptr->next; - } -} - - -char* -wKWMGetWorkspaceName(WScreen *scr, int workspace) -{ - Atom type_ret; - int fmt_ret; - unsigned long nitems_ret; - unsigned long bytes_after_ret; - char *data = NULL, *tmp; - char buffer[64]; - - assert(workspace >= 0 && workspace < MAX_WORKSPACES); - - if (_XA_KWM_DESKTOP_NAME_[workspace]==0) { - snprintf(buffer, sizeof(buffer), "KWM_DESKTOP_NAME_%d", workspace + 1); - - _XA_KWM_DESKTOP_NAME_[workspace] = XInternAtom(dpy, buffer, False); - } - - /* What do these people have against correctly using property types? */ - if (XGetWindowProperty(dpy, scr->root_win, - _XA_KWM_DESKTOP_NAME_[workspace], 0, 128, False, - XA_STRING, - &type_ret, &fmt_ret, &nitems_ret, &bytes_after_ret, - (unsigned char**)&data)!=Success || !data) - return NULL; - - tmp = wstrdup(data); - XFree(data); - - return tmp; -} - - -void -wKWMSetInitializedHint(WScreen *scr) -{ - setSimpleHint(scr->root_win, _XA_KWM_RUNNING, 1); -} - - -void -wKWMShutdown(WScreen *scr, Bool closeModules) -{ - KWMModuleList *ptr; - - XDeleteProperty(dpy, scr->root_win, _XA_KWM_RUNNING); - - if (closeModules) { - for (ptr = KWMModules; ptr != NULL; ptr = ptr->next) { - XKillClient(dpy, ptr->window); - } - } -} - - -Bool -wKWMCheckClientHints(WWindow *wwin, int *layer, int *workspace) -{ - long val; - Bool hasHint = False; - - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_UNSAVED_DATA, &val) - && val) { - - wwin->client_flags.broken_close = 1; - hasHint = True; - } else - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_DECORATION, &val)) { - if (val & KWMnoFocus) { - wwin->client_flags.no_focusable = 1; - } - switch (val & ~KWMnoFocus) { - case KWMnoDecoration: - wwin->client_flags.no_titlebar = 1; - wwin->client_flags.no_resizebar = 1; - break; - case KWMtinyDecoration: - wwin->client_flags.no_resizebar = 1; - break; - case KWMstandaloneMenuBar: - wwin->client_flags.no_titlebar = 1; - wwin->client_flags.no_resizebar = 1; - wwin->client_flags.no_resizable = 1; - wwin->client_flags.skip_window_list = 1; - wwin->client_flags.no_hide_others = 1; - wwin->flags.kwm_menubar = 1; - *layer = WMMainMenuLevel; - break; - case KWMdesktopIcon: - *layer = WMDesktopLevel; - break; - case KWMstaysOnTop: - *layer = WMFloatingLevel; - break; - case KWMnormalDecoration: - default: - break; - } - hasHint = True; - } else - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_DESKTOP, &val)) { - *workspace = val - 1; - hasHint = True; - } - - return hasHint; -} - - -Bool -wKWMCheckClientInitialState(WWindow *wwin) -{ - long val; - WArea area; - Bool hasHint = False; - - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_STICKY, &val) && val) { - - wwin->client_flags.omnipresent = 1; - hasHint = True; - } else - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_ICONIFIED, &val) && val) { - - wwin->flags.miniaturized = 1; - hasHint = True; - } else - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_MAXIMIZED, &val)) { - if (val == 2) - wwin->flags.maximized = MAX_VERTICAL; - else if (val == 1) - wwin->flags.maximized = MAX_HORIZONTAL; - else if (val == 3) - wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL; - hasHint = True; - } else - if (getAreaHint(wwin->client_win, _XA_KWM_WIN_GEOMETRY_RESTORE, &area) - && (wwin->old_geometry.x != area.x1 - || wwin->old_geometry.y != area.y1 - || wwin->old_geometry.width != area.x2 - area.x1 - || wwin->old_geometry.height != area.y2 - area.y1)) { - - wwin->old_geometry.x = area.x1; - wwin->old_geometry.y = area.y1; - wwin->old_geometry.width = area.x2 - area.x1; - wwin->old_geometry.height = area.y2 - area.y1; - hasHint = True; - } - - return hasHint; -} - - -Bool -wKWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event) -{ - Bool processed = True; - Bool flag; - long value; - - - if (!wwin->frame) { - return False; - } - - if (event->atom == _XA_KWM_WIN_UNSAVED_DATA) { -#ifdef DEBUG1 - printf("got KDE unsaved data change\n"); -#endif - - flag = getSimpleHint(wwin->client_win, _XA_KWM_WIN_UNSAVED_DATA, - &value) && value; - - if (flag != wwin->client_flags.broken_close) { - wwin->client_flags.broken_close = flag; - if (wwin->frame) - wWindowUpdateButtonImages(wwin); - } - } else if (event->atom == _XA_KWM_WIN_STICKY) { - -#ifdef DEBUG1 - printf("got KDE sticky change\n"); -#endif - flag = !getSimpleHint(wwin->client_win, _XA_KWM_WIN_STICKY, - &value) || value; - - if (flag != wwin->client_flags.omnipresent) { - - wWindowSetOmnipresent(wwin, flag); - } - } else if (event->atom == _XA_KWM_WIN_MAXIMIZED) { - int bla = 0; - -#ifdef DEBUG1 - printf("got KDE maximize change\n"); -#endif - flag = getSimpleHint(wwin->client_win, _XA_KWM_WIN_MAXIMIZED, &value); - - if (flag) { - if (value == 3) - bla = MAX_VERTICAL|MAX_HORIZONTAL; - else if (value == 2) - bla = MAX_VERTICAL; - else if (value == 1) - bla = MAX_HORIZONTAL; - } - - if (bla != wwin->flags.maximized) { - if (bla != 0) - wMaximizeWindow(wwin, bla); - else - wUnmaximizeWindow(wwin); - } - } else if (event->atom == _XA_KWM_WIN_ICONIFIED) { - -#ifdef DEBUG1 - printf("got KDE iconify change\n"); -#endif - flag = !getSimpleHint(wwin->client_win, _XA_KWM_WIN_ICONIFIED, - &value) || value; - - if (flag != wwin->flags.miniaturized) { - - if (flag) - wIconifyWindow(wwin); - else - wDeiconifyWindow(wwin); - } - - } else if (event->atom == _XA_KWM_WIN_DECORATION) { - Bool refresh = False; - int oldnofocus; - -#ifdef DEBUG1 - printf("got KDE decoration change\n"); -#endif - - oldnofocus = wwin->client_flags.no_focusable; - - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_DECORATION, &value)) { - wwin->client_flags.no_focusable = (value & KWMnoFocus)!=0; - - switch (value & ~KWMnoFocus) { - case KWMnoDecoration: - if (!WFLAGP(wwin, no_titlebar) || !WFLAGP(wwin, no_resizebar)) - refresh = True; - - wwin->client_flags.no_titlebar = 1; - wwin->client_flags.no_resizebar = 1; - break; - - case KWMtinyDecoration: - if (WFLAGP(wwin, no_titlebar) || !WFLAGP(wwin, no_resizebar)) - refresh = True; - - wwin->client_flags.no_titlebar = 0; - wwin->client_flags.no_resizebar = 1; - break; - - case KWMnormalDecoration: - default: - if (WFLAGP(wwin, no_titlebar) || WFLAGP(wwin, no_resizebar)) - refresh = True; - - wwin->client_flags.no_titlebar = 0; - wwin->client_flags.no_resizebar = 0; - break; - } - } else { - if (WFLAGP(wwin, no_titlebar) || WFLAGP(wwin, no_resizebar)) - refresh = True; - wwin->client_flags.no_focusable = (value & KWMnoFocus)!=0; - wwin->client_flags.no_titlebar = 0; - wwin->client_flags.no_resizebar = 0; - } - - if (refresh) - wWindowConfigureBorders(wwin); - - if (wwin->client_flags.no_focusable && !oldnofocus) { - - sendToModules(wwin->screen_ptr, _XA_KWM_MODULE_WIN_REMOVE, - wwin, 0); - wwin->flags.kwm_hidden_for_modules = 1; - - } else if (!wwin->client_flags.no_focusable && oldnofocus) { - - if (wwin->flags.kwm_hidden_for_modules) { - sendToModules(wwin->screen_ptr, _XA_KWM_MODULE_WIN_ADD, - wwin, 0); - wwin->flags.kwm_hidden_for_modules = 0; - } - } - } else if (event->atom == _XA_KWM_WIN_DESKTOP && wwin->frame) { -#ifdef DEBUG1 - printf("got KDE workspace change for %s\n", wwin->frame->title); -#endif - if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_DESKTOP, &value) - && value-1 != wwin->frame->workspace) { - wWindowChangeWorkspace(wwin, value-1); - } - - } else if (event->atom == _XA_KWM_WIN_GEOMETRY_RESTORE) { - WArea area; - -#ifdef DEBUG1 - printf("got KDE geometry restore change\n"); -#endif - if (getAreaHint(wwin->client_win, _XA_KWM_WIN_GEOMETRY_RESTORE, &area) - && (wwin->old_geometry.x != area.x1 - || wwin->old_geometry.y != area.y1 - || wwin->old_geometry.width != area.x2 - area.x1 - || wwin->old_geometry.height != area.y2 - area.y1)) { - - wwin->old_geometry.x = area.x1; - wwin->old_geometry.y = area.y1; - wwin->old_geometry.width = area.x2 - area.x1; - wwin->old_geometry.height = area.y2 - area.y1; - } - } else { - processed = False; - } - - return processed; -} - - -static Bool -performWindowCommand(WScreen *scr, char *command) -{ - WWindow *wwin = NULL; - - - wwin = scr->focused_window; - if (!wwin || !wwin->flags.focused || !wwin->flags.mapped) { - wwin = NULL; - } - - CloseWindowMenu(scr); - - - if (strcmp(command, "winMove")==0 || strcmp(command, "winResize")==0) { - - if (wwin) - wKeyboardMoveResizeWindow(wwin); - - } else if (strcmp(command, "winMaximize")==0) { - - if (wwin) - wMaximizeWindow(wwin, MAX_VERTICAL|MAX_HORIZONTAL); - - } else if (strcmp(command, "winRestore")==0) { - - if (wwin && wwin->flags.maximized) - wUnmaximizeWindow(wwin); - - } else if (strcmp(command, "winIconify")==0) { - - - if (wwin && !WFLAGP(wwin, no_miniaturizable)) { - if (wwin->protocols.MINIATURIZE_WINDOW) - wClientSendProtocol(wwin, _XA_GNUSTEP_WM_MINIATURIZE_WINDOW, - LastTimestamp); - else { - wIconifyWindow(wwin); - } - } - - } else if (strcmp(command, "winClose")==0) { - - if (wwin && !WFLAGP(wwin, no_closable)) { - if (wwin->protocols.DELETE_WINDOW) - wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp); - } - - } else if (strcmp(command, "winSticky")==0) { - - if (wwin) { - wWindowSetOmnipresent(wwin, !wwin->client_flags.omnipresent); - } - - } else if (strcmp(command, "winShade")==0) { - - if (wwin && !WFLAGP(wwin, no_shadeable)) { - if (wwin->flags.shaded) - wUnshadeWindow(wwin); - else - wShadeWindow(wwin); - } - - } else if (strcmp(command, "winOperation")==0) { - - if (wwin) - OpenWindowMenu(wwin, wwin->frame_x, - wwin->frame_y+wwin->frame->top_width, True); - - } else { - return False; - } - - return True; -} - - -static void -performCommand(WScreen *scr, char *command, XClientMessageEvent *event) -{ - assert(scr != NULL); - - if (strcmp(command, "commandLine")==0 - || strcmp(command, "execute")==0) { - char *cmd; - - cmd = ExpandOptions(scr, _("%a(Run Command,Type the command to run:)")); - if (cmd) { - ExecuteShellCommand(scr, cmd); - wfree(cmd); - } - } else if (strcmp(command, "logout")==0) { - - Shutdown(WSLogoutMode); - - } else if (strcmp(command, "refreshScreen")==0) { - - wRefreshDesktop(scr); - - } else if (strncmp(command, "go:", 3)==0) { - - Shutdown(WSRestartPreparationMode); - Restart(&command[3], False); - Restart(NULL, True); - - } else if (strcmp(command, "desktop+1")==0) { - - wWorkspaceRelativeChange(scr, 1); - - } else if (strcmp(command, "desktop-1")==0) { - - wWorkspaceRelativeChange(scr, -1); - - } else if (strcmp(command, "desktop+2")==0) { - - wWorkspaceRelativeChange(scr, 2); - - } else if (strcmp(command, "desktop-2")==0) { - - wWorkspaceRelativeChange(scr, -2); - - } else if (strcmp(command, "desktop%%2")==0) { - - if (scr->current_workspace % 2 == 1) - wWorkspaceRelativeChange(scr, 1); - else - wWorkspaceRelativeChange(scr, -1); - } else if (strncmp(command, "desktop", 7)==0) { - int ws; - - ws = atoi(&command[7]); - wWorkspaceChange(scr, ws); - - /* wmaker specific stuff */ - } else if (strcmp(command, "wmaker:info")==0) { - - wShowInfoPanel(scr); - - } else if (strcmp(command, "wmaker:legal")==0) { - - wShowLegalPanel(scr); - - } else if (strcmp(command, "wmaker:arrangeIcons")==0) { - - wArrangeIcons(scr, True); - - } else if (strcmp(command, "wmaker:showAll")==0) { - - wShowAllWindows(scr); - - } else if (strcmp(command, "wmaker:hideOthers")==0) { - - wHideOtherApplications(scr->focused_window); - - } else if (strcmp(command, "wmaker:restart")==0) { - - Shutdown(WSRestartPreparationMode); - Restart(NULL, True); - - } else if (strcmp(command, "wmaker:exit")==0) { - - Shutdown(WSExitMode); - -#ifdef UNSUPPORTED_STUFF - } else if (strcmp(command, "moduleRaised")==0) { /* useless */ - } else if (strcmp(command, "deskUnclutter")==0) { - } else if (strcmp(command, "deskCascade")==0) { - } else if (strcmp(command, "configure")==0) { - } else if (strcmp(command, "taskManager")==0) { - } else if (strcmp(command, "darkenScreen")==0) { /* breaks consistency */ -#endif - } else if (!performWindowCommand(scr, command)) { - KWMModuleList *module; - long mask = 0; - XEvent ev; - /* do message relay thing */ - - ev.xclient = *event; - for (module = KWMModules; module != NULL; module = module->next) { - - ev.xclient.window = module->window; - if (module->window == scr->root_win) - mask = SubstructureRedirectMask; - else - mask = 0; - - XSendEvent(dpy, module->window, False, mask, &ev); - } - } -} - - -Bool -wKWMProcessClientMessage(XClientMessageEvent *event) -{ - Bool processed = True; - WScreen *scr; -#ifdef DEBUG1 - printf("CLIENT MESS %s\n", XGetAtomName(dpy, event->message_type)); -#endif - if (event->message_type == _XA_KWM_COMMAND && event->format==8) { - char buffer[24]; - int i; - - scr = wScreenForRootWindow(event->window); - - for (i=0; i<20; i++) { - buffer[i] = event->data.b[i]; - } - buffer[i] = 0; - -#ifdef DEBUG1 - printf("got KDE command %s\n", buffer); -#endif - performCommand(scr, buffer, event); - - } else if (event->message_type == _XA_KWM_ACTIVATE_WINDOW) { - WWindow *wwin; - -#ifdef DEBUG1 - printf("got KDE activate internal\n"); -#endif - wwin = wWindowFor(event->data.l[0]); - - if (wwin) - wSetFocusTo(wwin->screen_ptr, wwin); - - } else if (event->message_type == _XA_KWM_DO_NOT_MANAGE - && event->format == 8) { - KWMDoNotManageList *node; - int i; - -#ifdef DEBUG1 - printf("got KDE dont manage\n"); -#endif - - node = malloc(sizeof(KWMDoNotManageList)); - if (!node) { - wwarning("out of memory processing KWM_DO_NOT_MANAGE message"); - } - for (i=0; i<20 && event->data.b[i]; i++) - node->title[i] = event->data.b[i]; - node->title[i] = 0; - - node->next = KWMDoNotManageCrap; - KWMDoNotManageCrap = node; - - } else if (event->message_type == _XA_KWM_MODULE) { - long val; - Window modwin = event->data.l[0]; - - scr = wScreenForRootWindow(event->window); - - if (getSimpleHint(modwin, _XA_KWM_MODULE, &val) && val) { -#ifdef DEBUG1 - puts("got KDE module startup"); -#endif - addModule(scr, modwin); - } else { -#ifdef DEBUG1 - puts("got KDE module finish"); -#endif - removeModule(scr, modwin); - } - } else { - processed = False; - } - - return processed; -} - - -void -wKWMCheckModule(WScreen *scr, Window window) -{ - long val; - - if (getSimpleHint(window, _XA_KWM_MODULE, &val) && val) { -#ifdef DEBUG1 - puts("got KDE module startup"); -#endif - addModule(scr, window); - } -} - - -Bool -wKWMCheckRootHintChange(WScreen *scr, XPropertyEvent *event) -{ - Bool processed = True; - long value; - - if (event->atom == _XA_KWM_CURRENT_DESKTOP) { - if (getSimpleHint(scr->root_win, _XA_KWM_CURRENT_DESKTOP, &value)) { -#ifdef DEBUG1 - printf("got KDE workspace switch to %li\n", value); -#endif - if (value-1 != scr->current_workspace) { - wWorkspaceChange(scr, value-1); - } - } - } else if (event->atom == _XA_KWM_NUMBER_OF_DESKTOPS) { -#ifdef DEBUG1 - printf("got KDE workspace number change\n"); -#endif - - if (getSimpleHint(scr->root_win, _XA_KWM_NUMBER_OF_DESKTOPS, &value)) { - - /* increasing is easy... */ - if (value > scr->workspace_count) { - scr->flags.kwm_syncing_count = 1; - - wWorkspaceMake(scr, value - scr->workspace_count); - - scr->flags.kwm_syncing_count = 0; - - } else if (value < scr->workspace_count) { - int i; - Bool rebuild = False; - - scr->flags.kwm_syncing_count = 1; - - /* decrease all we can do */ - for (i = scr->workspace_count; i >= value; i--) { - if (!wWorkspaceDelete(scr, i)) { - rebuild = True; - break; - } - } - - scr->flags.kwm_syncing_count = 0; - - /* someone destroyed a workspace that can't be destroyed. - * Reset the hints to reflect our internal state. - */ - if (rebuild) { - wKWMUpdateWorkspaceCountHint(scr); - } - } - } - } else { - int i; - - processed = False; - - for (i = 0; i < MAX_WORKSPACES && i < scr->workspace_count; i++) { - if (event->atom == _XA_KWM_DESKTOP_NAME_[i]) { - char *name; - - name = wKWMGetWorkspaceName(scr, i); - -#ifdef DEBUG1 - printf("got KDE workspace name change to %s\n", name); -#endif - - if (name && strncmp(name, scr->workspaces[i]->name, - MAX_WORKSPACENAME_WIDTH)!=0) { - scr->flags.kwm_syncing_name = 1; - wWorkspaceRename(scr, i, name); - scr->flags.kwm_syncing_name = 0; - } - if (name) - XFree(name); - processed = True; - break; - } else if (event->atom == _XA_KWM_WINDOW_REGION_[i]) { -#if 0 - WArea area; - - if (getAreaHint(scr->root_win, event->atom, &area)) { - - if (scr->totalUsableArea.x1 != area.x1 - || scr->totalUsableArea.y1 != area.y1 - || scr->totalUsableArea.x2 != area.x2 - || scr->totalUsableArea.y2 != area.y2) { - wScreenUpdateUsableArea(scr); - } - } -#else - if (i == scr->current_workspace % MAX_WORKSPACES) - wScreenUpdateUsableArea(scr); -#endif - - processed = True; - break; - } - } - } - - return processed; -} - - -Bool -wKWMManageableClient(WScreen *scr, Window win, char *title) -{ - KWMDoNotManageList *ptr, *next; - long val; - - if (getSimpleHint(win, _XA_KWM_DOCKWINDOW, &val) && val) { - addDockWindow(scr, win); - return False; - } - - ptr = KWMDoNotManageCrap; - /* - * TODO: support for glob patterns or regexes - */ - if (ptr && strncmp(ptr->title, title, strlen(ptr->title))==0) { - next = ptr->next; - wfree(ptr); - KWMDoNotManageCrap = next; -#ifdef DEBUG1 - printf("window %s not managed per KDE request\n", title); -#endif - - sendToModules(scr, _XA_KWM_MODULE_WIN_ADD, NULL, win); - sendToModules(scr, _XA_KWM_MODULE_WIN_REMOVE, NULL, win); - - return False; - } else if (ptr) { - while (ptr->next) { - if (strncmp(ptr->next->title, title, strlen(ptr->next->title))==0) { -#ifdef DEBUG1 - printf("window %s not managed per KDE request\n", title); -#endif - next = ptr->next->next; - wfree(ptr->next); - ptr->next = next; - - sendToModules(scr, _XA_KWM_MODULE_WIN_ADD, NULL, win); - sendToModules(scr, _XA_KWM_MODULE_WIN_REMOVE, NULL, win); - - return False; - } - - ptr = ptr->next; - } - } - - return True; -} - - -void -wKWMUpdateCurrentWorkspaceHint(WScreen *scr) -{ - setSimpleHint(scr->root_win, _XA_KWM_CURRENT_DESKTOP, - scr->current_workspace+1); - - sendToModules(scr, _XA_KWM_MODULE_DESKTOP_CHANGE, NULL, - scr->current_workspace+1); -} - - -void -wKWMUpdateActiveWindowHint(WScreen *scr) -{ - long val; - WWindow *wwin, *tmp; - - if (!scr->focused_window || !scr->focused_window->flags.focused) - val = None; - else { - val = (long)(scr->focused_window->client_win); - - /* raise the menubar thing */ - wwin = scr->focused_window; - tmp = wwin->prev; - while (tmp) { - if (tmp->flags.kwm_menubar - && tmp->transient_for == wwin->client_win) { - wRaiseFrame(tmp->frame->core); - break; - } - tmp = tmp->prev; - } - } - - XChangeProperty(dpy, scr->root_win, _XA_KWM_ACTIVE_WINDOW, - _XA_KWM_ACTIVE_WINDOW, 32, PropModeReplace, - (unsigned char*)&val, 1); - XFlush(dpy); -} - - -void -wKWMUpdateWorkspaceCountHint(WScreen *scr) -{ - if (scr->flags.kwm_syncing_count) - return; - - setSimpleHint(scr->root_win, _XA_KWM_NUMBER_OF_DESKTOPS, - scr->workspace_count); - - sendToModules(scr, _XA_KWM_MODULE_DESKTOP_NUMBER_CHANGE, NULL, - scr->workspace_count); -} - - -void -wKWMCheckDestroy(XDestroyWindowEvent *event) -{ - WScreen *scr; - - if (event->event == event->window) { - return; - } - - scr = wScreenSearchForRootWindow(event->event); - if (!scr) { - return; - } - - removeModule(scr, event->window); - removeDockWindow(scr, event->window); -} - - -void -wKWMUpdateWorkspaceNameHint(WScreen *scr, int workspace) -{ - char buffer[64]; - - assert(workspace >= 0 && workspace < MAX_WORKSPACES); - - if (_XA_KWM_DESKTOP_NAME_[workspace]==0) { - snprintf(buffer, sizeof(buffer), "KWM_DESKTOP_NAME_%d", workspace + 1); - - _XA_KWM_DESKTOP_NAME_[workspace] = XInternAtom(dpy, buffer, False); - } - - XChangeProperty(dpy, scr->root_win, _XA_KWM_DESKTOP_NAME_[workspace], - XA_STRING, 8, PropModeReplace, - (unsigned char*)scr->workspaces[workspace]->name, - strlen(scr->workspaces[workspace]->name)+1); - - sendToModules(scr, _XA_KWM_MODULE_DESKTOP_NAME_CHANGE, NULL, workspace+1); -} - - - -void -wKWMUpdateClientWorkspace(WWindow *wwin) -{ -#ifdef DEBUG1 - printf("updating workspace of %s to %i\n", - wwin->frame->title, wwin->frame->workspace+1); -#endif - setSimpleHint(wwin->client_win, _XA_KWM_WIN_DESKTOP, - wwin->frame->workspace+1); -} - - -void -wKWMUpdateClientGeometryRestore(WWindow *wwin) -{ - WArea rect; - - rect.x1 = wwin->old_geometry.x; - rect.y1 = wwin->old_geometry.y; - rect.x2 = wwin->old_geometry.x + wwin->old_geometry.width; - rect.y2 = wwin->old_geometry.y + wwin->old_geometry.height; - - setAreaHint(wwin->client_win, _XA_KWM_WIN_GEOMETRY_RESTORE, rect); -} - - -void -wKWMUpdateClientStateHint(WWindow *wwin, WKWMStateFlag flags) -{ - if (flags & KWMIconifiedFlag) { - setSimpleHint(wwin->client_win, _XA_KWM_WIN_ICONIFIED, - wwin->flags.miniaturized /*|| wwin->flags.shaded - || wwin->flags.hidden*/); - } - if (flags & KWMStickyFlag) { - setSimpleHint(wwin->client_win, _XA_KWM_WIN_STICKY, - IS_OMNIPRESENT(wwin)); - } - if (flags & KWMMaximizedFlag) { - int value = 0; - - if (wwin->flags.maximized & MAX_VERTICAL) - value |= 2; - if (wwin->flags.maximized & MAX_HORIZONTAL) - value |= 1; - - setSimpleHint(wwin->client_win, _XA_KWM_WIN_MAXIMIZED, value); - } -} - - -Bool -wKWMGetUsableArea(WScreen *scr, int head, WArea *area) -{ - char buffer[64]; - Bool ok; - int region = scr->current_workspace % MAX_WORKSPACES; - - if (_XA_KWM_WINDOW_REGION_[region]==0) { - snprintf(buffer, sizeof(buffer), "KWM_WINDOW_REGION_%d", 1+region); - - _XA_KWM_WINDOW_REGION_[region] = XInternAtom(dpy, buffer, False); - } - - ok = getAreaHint(scr->root_win, _XA_KWM_WINDOW_REGION_[region], area); - - if (ok) { - WMRect rect = wGetRectForHead(scr, head); - - area->x1 = WMAX(area->x1, rect.pos.x); - area->x2 = WMIN(area->x2, rect.pos.x + rect.size.width); - area->y1 = WMAX(area->y1, rect.pos.y); - area->y2 = WMIN(area->y2, rect.pos.y + rect.size.height); - } - - return ok; -} - - - -Bool -wKWMGetIconGeometry(WWindow *wwin, WArea *area) -{ - return getAreaHint(wwin->client_win, _XA_KWM_WIN_ICON_GEOMETRY, area); -} - - - -#ifdef not_used -void -wKWMSetUsableAreaHint(WScreen *scr, int workspace) -{ - /* if we set this after making changes of our own to the area, - * the next time the area changes, we won't know what should - * be the new final area. This protocol isn't worth a shit :/ - */ - /* - * According to Matthias Ettrich: - * Indeed, there's no protocol to deal with the area yet in case several - * clients want to influence it. It is sufficent, though, if it is clear - * that one process is responsable for the area. For KDE this is kpanel, but - * I see that there might be a conflict with the docking area of windowmaker - * itself. - * - */ - -#ifdef notdef - char buffer[64]; - - assert(workspace >= 0 && workspace < MAX_WORKSPACES); - - if (_XA_KWM_WINDOW_REGION_[workspace]==0) { - snprintf(buffer, sizeof(buffer), "KWM_WINDOW_REGION_%d", workspace+1); - - _XA_KWM_WINDOW_REGION_[workspace] = XInternAtom(dpy, buffer, False); - } - - setAreaHint(scr->root_win, _XA_KWM_WINDOW_REGION_[workspace], - scr->totalUsableArea); -#endif -} -#endif /* not_used */ - -void -wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message) -{ - Atom msg; - - if (wwin && (wwin->flags.internal_window - || wwin->flags.kwm_hidden_for_modules - || !wwin->flags.kwm_managed - || WFLAGP(wwin, skip_window_list))) - return; - - switch (message) { - case WKWMAddWindow: - msg = _XA_KWM_MODULE_WIN_ADD; - break; - case WKWMRemoveWindow: - msg = _XA_KWM_MODULE_WIN_REMOVE; - break; - case WKWMFocusWindow: - msg = _XA_KWM_MODULE_WIN_ACTIVATE; - break; - case WKWMRaiseWindow: - msg = _XA_KWM_MODULE_WIN_RAISE; - break; - case WKWMLowerWindow: - msg = _XA_KWM_MODULE_WIN_LOWER; - break; - case WKWMChangedClient: - msg = _XA_KWM_MODULE_WIN_CHANGE; - break; - case WKWMIconChange: - msg = _XA_KWM_MODULE_WIN_ICON_CHANGE; - break; - default: - return; - } - - sendToModules(wwin ? wwin->screen_ptr : NULL, msg, wwin, 0); -} - -#if 0 -static void -writeSocket(int sock, char *data) -{ - char buffer[128]; - - snprintf(buffer, sizeof(buffer), "%i ", strlen(data)); - write(sock, buffer, strlen(buffer)); - write(sock, data, strlen(data)); -} - - -static int -connectKFM(WScreen *scr) -{ - char *path; - char *buffer; - char *ptr; - FILE *f; - int pid; - int sock = 0; - struct sockaddr_un addr; - char buf[256]; - - path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/pid"); - buffer = wstrdup(getenv("DISPLAY")); - - ptr = strchr(buffer, ':'); - if (ptr) - *ptr = '_'; - - ptr = strrchr(buffer, '.'); - if (ptr) - *ptr = 0; - { - char b[32]; - - snprintf(b, sizeof(b), ".%i", scr->screen); - - buffer = wstrappend(buffer, b); - } - path = wstrappend(path, buffer); - wfree(buffer); - - /* pid file */ - f = fopen(path, "rb"); - wfree(path); - if (!f) - return -1; - - *buf = 0; - fgets(buf, sizeof(buf), f); - buf[sizeof(buf)] = 0; - pid = atoi(buf); - if (pid <= 0) - return -1; - - if (kill(pid, 0) != 0) - return -1; - - *buf = 0; - fgets(buf, sizeof(buf), f); - buf[sizeof(buf)] = 0; - fclose(f); - - sock = socket(AF_UNIX, SOCK_STREAM, 0); - if (sock < 0) - return -1; - addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, buf); - - if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0) { - close(sock); - return -1; - } - - path = wstrconcat(wgethomedir(), "/.kde/share/apps/kfm/magic"); - f = fopen(path, "rb"); - wfree(path); - if (!f) { - return -1; - } - ptr = fgets(buf, sizeof(buf), f); - fclose(f); - if (!ptr) { - return -1; - } - puts(buffer); - - ptr = wstrconcat("auth", buf); - - writeSocket(sock, ptr); - wfree(ptr); - - return sock; -} -#endif - -void -wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, Bool control) -{ -#if 0 - char buffer[128]; - int sock; - - puts("CONNECTING"); - sock = connectKFM(scr); - if (sock < 0) - return; - puts("SENDING DATA"); - - sprintf(buffer, "selectRootIcons %i %i %i %i %c", x, y, w, h, control); - writeSocket(sock, buffer); - - close(sock); -#endif -} - - -static void -observer(void *self, WMNotification *notif) -{ - WScreen *scr = (WScreen*)self; - WWindow *wwin = (WWindow*)WMGetNotificationObject(notif); - const char *name = WMGetNotificationName(notif); - void *data = WMGetNotificationClientData(notif); - - if (strcmp(name, WMNManaged) == 0 && wwin) { - wKWMUpdateClientWorkspace(wwin); - wKWMUpdateClientStateHint(wwin, KWMAllFlags); - - wwin->flags.kwm_managed = 1; - - wKWMSendEventMessage(wwin, WKWMAddWindow); - - } else if (strcmp(name, WMNUnmanaged) == 0 && wwin) { - wwin->frame->workspace = -1; - - wKWMUpdateClientWorkspace(wwin); - - wKWMSendEventMessage(wwin, WKWMRemoveWindow); - - } else if (strcmp(name, WMNChangedWorkspace) == 0 && wwin) { - wKWMUpdateClientWorkspace(wwin); - wKWMSendEventMessage(wwin, WKWMChangedClient); - - } else if (strcmp(name, WMNChangedFocus) == 0) { - wKWMUpdateActiveWindowHint(scr); - wKWMSendEventMessage(wwin, WKWMFocusWindow); - - } else if (strcmp(name, WMNChangedName) == 0) { - wKWMSendEventMessage(wwin, WKWMChangedClient); - - } else if (strcmp(name, WMNChangedState) == 0) { - char *detail = (char*)data; - - if (strcmp(detail, "shade") == 0) { - wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag); - wKWMSendEventMessage(wwin, WKWMChangedClient); - } else if (strcmp(detail, "omnipresent") == 0) { - wKWMUpdateClientStateHint(wwin, KWMStickyFlag); - wKWMSendEventMessage(wwin, WKWMChangedClient); - } else if (strcmp(detail, "maximize") == 0) { - wKWMUpdateClientStateHint(wwin, KWMMaximizedFlag); - wKWMSendEventMessage(wwin, WKWMChangedClient); - } else if (strcmp(detail, "iconify-transient") == 0) { - if (wwin->flags.miniaturized) { - wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag); - wKWMSendEventMessage(wwin, WKWMRemoveWindow); - wwin->flags.kwm_hidden_for_modules = 1; - } else { - wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag); - if (wwin->flags.kwm_hidden_for_modules) { - wKWMSendEventMessage(wwin, WKWMAddWindow); - wwin->flags.kwm_hidden_for_modules = 0; - } - } - } else if (strcmp(detail, "iconify") == 0) { - wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag); - wKWMSendEventMessage(wwin, WKWMChangedClient); - } else if (strcmp(detail, "hide") == 0) { - wKWMUpdateClientStateHint(wwin, KWMIconifiedFlag); - wKWMSendEventMessage(wwin, WKWMChangedClient); - } - - } else if (strcmp(name, WMNChangedStacking) == 0 && wwin) { - if (data == NULL) - wKWMBroadcastStacking(wwin->screen_ptr); - else if (strcmp(data, "lower") == 0) - wKWMSendEventMessage(wwin, WKWMLowerWindow); - else if (strcmp(data, "raise") == 0) - wKWMSendEventMessage(wwin, WKWMRaiseWindow); - } -} - - -static void -wsobserver(void *self, WMNotification *notif) -{ - WScreen *scr = (WScreen*)WMGetNotificationObject(notif); - const char *name = WMGetNotificationName(notif); - void *data = WMGetNotificationClientData(notif); - - if (strcmp(name, WMNWorkspaceCreated) == 0) { - if (!scr->flags.kwm_syncing_count) { - wKWMUpdateWorkspaceCountHint(scr); - wKWMUpdateWorkspaceNameHint(scr, (int)data); - } -#ifdef not_used - wKWMSetUsableAreaHint(scr, scr->workspace_count-1); -#endif - } else if (strcmp(name, WMNWorkspaceDestroyed) == 0) { - wKWMUpdateWorkspaceCountHint(scr); - } else if (strcmp(name, WMNWorkspaceNameChanged) == 0) { - wKWMUpdateWorkspaceNameHint(scr, (int)data); - } else if (strcmp(name, WMNWorkspaceChanged) == 0) { - wKWMUpdateCurrentWorkspaceHint(scr); - - } else if (strcmp(name, WMNResetStacking) == 0) { - wKWMBroadcastStacking(scr); - } -} - - -#endif /* KWM_HINTS */ - diff --git a/src/kwm.h b/src/kwm.h deleted file mode 100644 index 2687e117..00000000 --- a/src/kwm.h +++ /dev/null @@ -1,102 +0,0 @@ -/* kde.h-- stuff for support for kde hints - * - * Window Maker window manager - * - * Copyright (c) 1998-2003 Alfredo K. Kojima - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -#ifndef _KWM_H_ -#define _KWM_H_ - -typedef enum { - KWMStickyFlag = (1<<0), - KWMMaximizedFlag = (1<<1), - KWMIconifiedFlag = (1<<2), - KWMAllFlags = 7 -} WKWMStateFlag; - -typedef enum { - WKWMAddWindow, - WKWMRemoveWindow, - WKWMFocusWindow, - WKWMRaiseWindow, - WKWMLowerWindow, - WKWMChangedClient, - WKWMIconChange -} WKWMEventMessage; - - -void wKWMInitStuff(WScreen *scr); - -Bool wKWMGetUsableArea(WScreen *scr, int head, WArea *area); - -Bool wKWMCheckClientHints(WWindow *wwin, int *layer, int *workspace); - -Bool wKWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event); - -Bool wKWMCheckRootHintChange(WScreen *scr, XPropertyEvent *event); - -void wKWMUpdateWorkspaceCountHint(WScreen *scr); - -void wKWMUpdateWorkspaceNameHint(WScreen *scr, int workspace); - -void wKWMUpdateCurrentWorkspaceHint(WScreen *scr); - -Bool wKWMProcessClientMessage(XClientMessageEvent *event); - -void wKWMUpdateClientGeometryRestore(WWindow *wwin); - -void wKWMUpdateClientWorkspace(WWindow *wwin); - -void wKWMUpdateClientStateHint(WWindow *wwin, WKWMStateFlag flags); - -Bool wKWMManageableClient(WScreen *scr, Window win, char *title); - -Bool wKWMCheckClientInitialState(WWindow *wwin); - -#ifdef not_used -void wKWMSetUsableAreaHint(WScreen *scr, int workspace); -#endif - -void wKWMSetInitializedHint(WScreen *scr); - -void wKWMShutdown(WScreen *scr, Bool closeModules); - -void wKWMCheckModule(WScreen *scr, Window window); - -void wKWMSendWindowCreateMessage(WWindow *wwin, Bool create); - -void wKWMSendEventMessage(WWindow *wwin, WKWMEventMessage message); - -void wKWMCheckDestroy(XDestroyWindowEvent *event); - -void wKWMUpdateActiveWindowHint(WScreen *scr); - -void wKWMSendStacking(WScreen *scr, Window module); - -void wKWMBroadcastStacking(WScreen *scr); - -char *wKWMGetWorkspaceName(WScreen *scr, int workspace); - -Bool wKWMGetIconGeometry(WWindow *wwin, WArea *area); - -void wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, - Bool control); - -#endif - diff --git a/src/moveres.c b/src/moveres.c index a1607681..58db3a12 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -47,10 +47,6 @@ #include -#ifdef KWM_HINTS -#include "kwm.h" -#endif - /* How many different types of geometry/position display thingies are there? */ #define NUM_DISPLAYS 5 @@ -2327,11 +2323,6 @@ wSelectWindows(WScreen *scr, XEvent *ev) XUngrabPointer(dpy, CurrentTime); selectWindowsInside(scr, x, y, x + w, y + h); -#ifdef KWM_HINTS - wKWMSelectRootRegion(scr, xp, yp, w, h, - event.xbutton.state & ControlMask); -#endif /* KWM_HINTS */ - #ifdef DEBUG puts("End window selection"); #endif diff --git a/src/openlook.c b/src/openlook.c deleted file mode 100644 index b9e6f3f8..00000000 --- a/src/openlook.c +++ /dev/null @@ -1,429 +0,0 @@ -/* - * openlook.c - OPEN LOOK (tm) compatibility stuff - * - * Window Maker window manager - * - * Copyright (c) 1998-2003 Alfredo K. Kojima - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -/* - * Semantics and hint information taken from olwm code - */ - -#include "wconfig.h" - -#ifdef OLWM_HINTS - - -#include -#include -#include - -#include -#include -#include - - -#include "WindowMaker.h" - -#include "wcore.h" -#include "framewin.h" -#include "window.h" -#include "properties.h" -#include "icon.h" -#include "client.h" -#include "funcs.h" - -#include "openlook.h" - - -/* pin states */ -#define OL_PIN_OUT 0 -#define OL_PIN_IN 1 - -/* flags */ -#define OL_DECORATION_HEADER (1<<0) -#define OL_DECORATION_FOOTER (1<<1) -#define OL_DECORATION_PUSHPIN (1<<2) -#define OL_DECORATION_CLOSEBUTTON (1<<3) -#define OL_DECORATION_RESIZEABLE (1<<4) -#define OL_DECORATION_ICONNAME (1<<5) -#define OL_DECORATION_WARPTOPIN (1<<6) -#define OL_DECORATION_NONE (1<<7) - - - -typedef struct { - long flags; - Atom winType; - Atom menuType; - long pinInitState; - long cancel; -} OLHints; - -#define OL_WINTYPE (1<<0) -#define OL_MENUTYPE (1<<1) -#define OL_PINSTATE (1<<2) -#define OL_CANCEL (1<<3) - - - -typedef struct { - unsigned used:1; - - unsigned semantic:1; - - unsigned semantic_compose:1; - unsigned semantic_capslock:1; - unsigned semantic_numlock:1; - unsigned semantic_scrolllock:1; -} WOLWindowState; - - -static Atom _XA_SUN_WM_PROTOCOLS = 0; - -#ifdef unused -static Bool -getWindowState(Window win, OLWindowState *state) -{ - static Atom _XA_SUN_WINDOW_STATE = 0; - unsigned long *data; - - if (!_XA_SUN_WINDOW_STATE) { - _XA_SUN_WINDOW_STATE = XInternAtom(dpy, "_SUN_WINDOW_STATE", False); - } - - data = (unsigned long*)PropGetCheckProperty(win, _XA_SUN_WINDOW_STATE, - XA_INTEGER, 32, 2, NULL); - - if (!data) { - return False; - } - - state->flags = data[0]; - state->state = data[1]; - - XFree(data); - - return True; -} -#endif - -static Bool -getWindowHints(Window window, OLHints *hints) -{ - long *data; - int count; - static Atom _XA_OL_WIN_ATTR = 0; - - if (!_XA_OL_WIN_ATTR) { - _XA_OL_WIN_ATTR = XInternAtom(dpy, "_OL_WIN_ATTR", False); - } - - data = (long*)PropGetCheckProperty(window, _XA_OL_WIN_ATTR, - _XA_OL_WIN_ATTR, 32, 0, &count); - - if (!data) - return False; - - if (count == 3) { - /* old format */ - - hints->flags = OL_WINTYPE|OL_MENUTYPE|OL_PINSTATE; - hints->winType = data[0]; - hints->menuType = data[1]; - hints->pinInitState = data[2]; - hints->cancel = 0; - - } else if (count == 5) { - /* new format */ - - hints->flags = data[0]; - hints->winType = data[1]; - hints->menuType = data[2]; - hints->pinInitState = data[3]; - hints->cancel = data[4]; - - } else { - XFree(data); - return False; - } - - XFree(data); - - /* do backward compatibility stuff */ - if (hints->flags & OL_PINSTATE) { - static Atom pinIn = 0, pinOut; - - if (!pinIn) { - pinIn = XInternAtom(dpy, "_OL_PIN_IN", False); - pinOut = XInternAtom(dpy, "_OL_PIN_OUT", False); - } - - if (hints->pinInitState == pinIn) - hints->pinInitState = OL_PIN_IN; - else if (hints->pinInitState == pinOut) - hints->pinInitState = OL_PIN_OUT; - } - - return True; -} - - - - -static void -applyDecorationHints(Window win, int *flags) -{ - Atom *atoms; - static Atom _XA_OL_DECOR_ADD = 0; - static Atom _XA_OL_DECOR_DEL = 0; - static Atom _XA_CLOSE, _XA_FOOTER, _XA_RESIZE, _XA_HEADER, _XA_PIN, - _XA_ICONNAME; - int count; - int i; - - if (!_XA_OL_DECOR_DEL) { - _XA_OL_DECOR_ADD = XInternAtom(dpy, "_OL_DECOR_ADD", False); - _XA_OL_DECOR_DEL = XInternAtom(dpy, "_OL_DECOR_DEL", False); - - _XA_CLOSE = XInternAtom(dpy, "_OL_DECOR_CLOSE", False); - _XA_FOOTER = XInternAtom(dpy, "_OL_DECOR_FOOTER", False); - _XA_RESIZE = XInternAtom(dpy, "_OL_DECOR_RESIZE", False); - _XA_HEADER = XInternAtom(dpy, "_OL_DECOR_HEADER", False); - _XA_PIN = XInternAtom(dpy, "_OL_DECOR_PIN", False); - _XA_ICONNAME = XInternAtom(dpy, "_OL_DECOR_ICON_NAME", False); - } - - atoms = (Atom*)PropGetCheckProperty(win, _XA_OL_DECOR_ADD, XA_ATOM, 32, 0, - &count); - if (atoms) { - for (i=0; i < count; i++) { - if (atoms[i] == _XA_CLOSE) - *flags |= OL_DECORATION_CLOSEBUTTON; - else if (atoms[i] == _XA_FOOTER) - *flags |= OL_DECORATION_FOOTER; - else if (atoms[i] == _XA_RESIZE) - *flags |= OL_DECORATION_RESIZEABLE; - else if (atoms[i] == _XA_HEADER) - *flags |= OL_DECORATION_HEADER; - else if (atoms[i] == _XA_PIN) - *flags |= OL_DECORATION_PUSHPIN; - else if (atoms[i] == _XA_ICONNAME) - *flags |= OL_DECORATION_ICONNAME; - } - XFree(atoms); - } - - atoms = (Atom*)PropGetCheckProperty(win, _XA_OL_DECOR_DEL, XA_ATOM, 32, 0, - &count); - if (atoms) { - for (i=0; i < count; i++) { - if (atoms[i] == _XA_CLOSE) - *flags &= ~OL_DECORATION_CLOSEBUTTON; - else if (atoms[i] == _XA_FOOTER) - *flags &= ~OL_DECORATION_FOOTER; - else if (atoms[i] == _XA_RESIZE) - *flags &= ~OL_DECORATION_RESIZEABLE; - else if (atoms[i] == _XA_HEADER) - *flags &= ~OL_DECORATION_HEADER; - else if (atoms[i] == _XA_PIN) - *flags &= ~OL_DECORATION_PUSHPIN; - else if (atoms[i] == _XA_ICONNAME) - *flags &= ~OL_DECORATION_ICONNAME; - } - XFree(atoms); - } -} - - -void -wOLWMInitStuff(WScreen *scr) -{ - static Atom _SUN_OL_WIN_ATTR_5; - - if (!_XA_SUN_WM_PROTOCOLS) { - _XA_SUN_WM_PROTOCOLS = XInternAtom(dpy, "_SUN_WM_PROTOCOLS", False); - _SUN_OL_WIN_ATTR_5 = XInternAtom(dpy, "_SUN_OL_WIN_ATTR_5", False); - } - - XChangeProperty(dpy, scr->root_win, _XA_SUN_WM_PROTOCOLS, XA_ATOM, 32, - PropModeReplace, (unsigned char*)&_SUN_OL_WIN_ATTR_5, 1); -} - - -void -wOLWMChangePushpinState(WWindow *wwin, Bool state) -{ - static Atom pinState = 0; - - if (!pinState) { - pinState = XInternAtom(dpy, "_OL_PIN_STATE", False); - } - - XChangeProperty(dpy, wwin->client_win, pinState, XA_INTEGER, 32, - PropModeReplace, (unsigned char *)&state, 1); -} - - -void -wOLWMShutdown(WScreen *scr) -{ - XDeleteProperty(dpy, scr->root_win, _XA_SUN_WM_PROTOCOLS); -} - - -#ifdef unfinished -void -wOLWMUpdateWindowState(WWindow *wwin) -{ - if (wwin->ol_window_state.used) { - if (wwin->ol_window_state.semantic) { - if (wwin->ol_window_state.semantic_compose) - setComposeLed(True); - else - setComposeLed(False); - } - } else { - setComposeLed(False); - } -} -#endif /* unfinished */ - -void -wOLWMCheckClientHints(WWindow *wwin) -{ - OLHints hints; - static Atom WT_BASE = 0, WT_CMD, WT_NOTICE, WT_HELP, WT_OTHER; - static Atom MT_FULL, MT_LIMITED, MT_NONE; - int decoration; - int pinInitState = OL_PIN_IN; - Atom menuType; - - if (!WT_BASE) { - WT_BASE = XInternAtom(dpy, "_OL_WT_BASE", False); - WT_CMD = XInternAtom(dpy, "_OL_WT_CMD", False); - WT_NOTICE = XInternAtom(dpy, "_OL_WT_NOTICE", False); - WT_HELP = XInternAtom(dpy, "_OL_WT_HELP", False); - WT_OTHER = XInternAtom(dpy, "_OL_WT_OTHER", False); - - MT_FULL = XInternAtom(dpy, "_OL_MENU_FULL", False); - MT_LIMITED = XInternAtom(dpy, "_OL_MENU_LIMITED", False); - MT_NONE = XInternAtom(dpy, "_OL_NONE", False); - } - - /* get attributes */ - - if (!getWindowHints(wwin->client_win, &hints) || - !(hints.flags & OL_WINTYPE)) { - - decoration = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE - |OL_DECORATION_HEADER|OL_DECORATION_ICONNAME; - - menuType = MT_FULL; - - } else { - if (hints.winType == WT_BASE) { - - decoration = OL_DECORATION_CLOSEBUTTON|OL_DECORATION_RESIZEABLE - |OL_DECORATION_HEADER|OL_DECORATION_ICONNAME; - - menuType = MT_FULL; - - } else if (hints.winType == WT_CMD) { - - decoration = OL_DECORATION_PUSHPIN|OL_DECORATION_RESIZEABLE - |OL_DECORATION_HEADER|OL_DECORATION_ICONNAME; - - menuType = MT_LIMITED; - - /* this is a transient-like window */ - wwin->client_flags.olwm_transient = 1; - - } else if (hints.winType == WT_NOTICE) { - - decoration = OL_DECORATION_ICONNAME; - menuType = MT_NONE; - - } else if (hints.winType == WT_HELP) { - - decoration = OL_DECORATION_PUSHPIN|OL_DECORATION_HEADER - |OL_DECORATION_ICONNAME|OL_DECORATION_WARPTOPIN; - menuType = MT_LIMITED; - - } else if (hints.winType == WT_OTHER) { - - decoration = OL_DECORATION_ICONNAME; - menuType = MT_NONE; - - if (hints.flags & OL_MENUTYPE) { - menuType = hints.menuType; - } - } - - if (hints.flags & OL_PINSTATE) { - pinInitState = hints.pinInitState; - } else { - pinInitState = OL_PIN_OUT; - } - } - - /* mask attributes with decoration hints */ - applyDecorationHints(wwin->client_win, &decoration); - - if ((decoration & OL_DECORATION_CLOSEBUTTON) - && (decoration & OL_DECORATION_PUSHPIN)) - decoration &= ~OL_DECORATION_CLOSEBUTTON; - - if (!(decoration & OL_DECORATION_PUSHPIN)) - decoration &= ~OL_DECORATION_WARPTOPIN; - - - /* map the hints to our attributes */ - if (menuType == MT_FULL) - wwin->flags.olwm_limit_menu = 0; - else - wwin->flags.olwm_limit_menu = 1; - - /* - * Emulate olwm pushpin. - * If the initial state of the pin is in, then put the normal close - * button. If not, make the close button different and when the - * user moves the window or clicks in the close button, turn it - * into a normal close button. - */ - if ((decoration & OL_DECORATION_PUSHPIN) && pinInitState==OL_PIN_OUT) { - wwin->flags.olwm_push_pin_out = 1; - - wOLWMChangePushpinState(wwin, False); - } else { - wOLWMChangePushpinState(wwin, True); - } - - if (!(decoration & OL_DECORATION_RESIZEABLE)) { - wwin->client_flags.no_resizable = 1; - wwin->client_flags.no_resizebar = 1; - } - - if (decoration & OL_DECORATION_WARPTOPIN) { - wwin->client_flags.olwm_warp_to_pin = 1; - } - -} -#endif - diff --git a/src/openlook.h b/src/openlook.h deleted file mode 100644 index 3e803875..00000000 --- a/src/openlook.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * openlook.h - OPEN LOOK (tm) compatibility stuff - * - * Window Maker window manager - * - * Copyright (c) 1998-2003 Alfredo K. Kojima - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -#ifndef _OPENLOOK_H_ -#define _OPENLOOK_H_ - - -void wOLWMInitStuff(WScreen *scr); - -void wOLWMShutdown(WScreen *scr); - -void wOLWMCheckClientHints(WWindow *wwin); - -void wOLWMChangePushpinState(WWindow *wwin, Bool state); - -#endif - diff --git a/src/properties.c b/src/properties.c index 0a52f05d..080c1664 100644 --- a/src/properties.c +++ b/src/properties.c @@ -373,10 +373,6 @@ PropCleanUp(Window root) XDeleteProperty(dpy, root, _XA_WINDOWMAKER_NOTICEBOARD); XDeleteProperty(dpy, root, XA_WM_ICON_SIZE); - -#ifdef KWM_HINTS - XDeleteProperty(dpy, root, XInternAtom(dpy, "KWM_RUNNING", False)); -#endif } diff --git a/src/screen.c b/src/screen.c index f91a9d19..01fe0c6e 100644 --- a/src/screen.c +++ b/src/screen.c @@ -53,15 +53,6 @@ #include "session.h" #include "balloon.h" #include "geomview.h" -#ifdef KWM_HINTS -# include "kwm.h" -#endif -#ifdef GNOME_STUFF -# include "gnome.h" -#endif -#ifdef OLWM_HINTS -# include "openlook.h" -#endif #ifdef NETWM_HINTS # include "wmspec.h" #endif @@ -778,18 +769,6 @@ wScreenInit(int screen_number) createInternalWindows(scr); -#ifdef KWM_HINTS - wKWMInitStuff(scr); -#endif - -#ifdef GNOME_STUFF - wGNOMEInitStuff(scr); -#endif - -#ifdef OLWM_HINTS - wOLWMInitStuff(scr); -#endif - #ifdef NETWM_HINTS wNETWMInitStuff(scr); #endif @@ -892,30 +871,6 @@ wScreenUpdateUsableArea(WScreen *scr) } #endif -#ifdef GNOME_STUFF - { - WArea area; - if (wGNOMEGetUsableArea(scr, i, &area)) { - scr->totalUsableArea[i].x1 = WMAX(scr->totalUsableArea[i].x1, area.x1); - scr->totalUsableArea[i].y1 = WMAX(scr->totalUsableArea[i].y1, area.y1); - scr->totalUsableArea[i].x2 = WMIN(scr->totalUsableArea[i].x2, area.x2); - scr->totalUsableArea[i].y2 = WMIN(scr->totalUsableArea[i].y2, area.y2); - } - } -#endif - -#ifdef KWM_HINTS - { - WArea area; - if (wKWMGetUsableArea(scr, i, &area)) { - scr->totalUsableArea[i].x1 = WMAX(scr->totalUsableArea[i].x1, area.x1); - scr->totalUsableArea[i].y1 = WMAX(scr->totalUsableArea[i].y1, area.y1); - scr->totalUsableArea[i].x2 = WMIN(scr->totalUsableArea[i].x2, area.x2); - scr->totalUsableArea[i].y2 = WMIN(scr->totalUsableArea[i].y2, area.y2); - } - } -#endif - scr->usableArea[i] = scr->totalUsableArea[i]; #if 0 @@ -1033,64 +988,6 @@ wScreenUpdateUsableArea(WScreen *scr) } #endif -#ifdef KWM_HINTS - { - WArea area; - if (wKWMGetUsableArea(scr, &area)) { - scr->totalUsableArea.x1 = WMAX(scr->totalUsableArea.x1, area.x1); - scr->totalUsableArea.y1 = WMAX(scr->totalUsableArea.y1, area.y1); - scr->totalUsableArea.x2 = WMIN(scr->totalUsableArea.x2, area.x2); - scr->totalUsableArea.y2 = WMIN(scr->totalUsableArea.y2, area.y2); - } - } -#endif - -#ifdef GNOME_STUFF - { - WReservedArea *area = scr->reservedAreas; - - while (area) { - int th, bh; - int lw, rw; - int w, h; - - w = area->area.x2 - area->area.x1; - h = area->area.y2 - area->area.y1; - - th = area->area.y1; - bh = scr->scr_height - area->area.y2; - lw = area->area.x1; - rw = scr->scr_width - area->area.x2; - - if (WMIN(th, bh) <= WMIN(lw, rw)) { - /* horizontal */ - if (th < bh) { - /* on top */ - if (scr->totalUsableArea.y1 < area->area.y2) - scr->totalUsableArea.y1 = area->area.y2; - } else { - /* on bottom */ - if (scr->totalUsableArea.y2 > area->area.y1) - scr->totalUsableArea.y2 = area->area.y1; - } - } else { - /* vertical */ - if (lw < rw) { - /* on left */ - if (scr->totalUsableArea.x1 < area->area.x2) - scr->totalUsableArea.x1 = area->area.x2; - } else { - /* on right */ - if (scr->totalUsableArea.x2 > area->area.x1) - scr->totalUsableArea.x2 = area->area.x1; - } - } - - area = area->next; - } - } -#endif /* GNOME_STUFF */ - if (scr->totalUsableArea.x2 - scr->totalUsableArea.x1 < scr->scr_width/2) { scr->totalUsableArea.x2 = scr->usableArea.x2; scr->totalUsableArea.x1 = scr->usableArea.x1; @@ -1100,18 +997,6 @@ wScreenUpdateUsableArea(WScreen *scr) scr->totalUsableArea.y1 = scr->usableArea.y1; } -#ifdef not_used -#ifdef KWM_HINTS - { - int i; - - for (i = 0; i < scr->workspace_count; i++) { - wKWMSetUsableAreaHint(scr, i); - } - } -#endif -#endif - #ifdef NETWM_HINTS wNETWMUpdateWorkarea(scr); #endif diff --git a/src/screen.h b/src/screen.h index df850bed..5c4b8b05 100644 --- a/src/screen.h +++ b/src/screen.h @@ -299,10 +299,6 @@ typedef struct _WScreen { char *xdestring; #endif -#ifdef KWM_HINTS - Window kwm_dock; -#endif - #ifdef NETWM_HINTS struct NetData *netdata; #endif @@ -327,10 +323,6 @@ typedef struct _WScreen { unsigned int doing_alt_tab:1; unsigned int jump_back_pending:1; unsigned int ignore_focus_events:1; -#ifdef KWM_HINTS - unsigned int kwm_syncing_name:1; - unsigned int kwm_syncing_count:1; -#endif } flags; } WScreen; diff --git a/src/shutdown.c b/src/shutdown.c index b4ee6dd6..3f159c53 100644 --- a/src/shutdown.c +++ b/src/shutdown.c @@ -36,12 +36,6 @@ #include "properties.h" #include "session.h" #include "winspector.h" -#ifdef KWM_HINTS -# include "kwm.h" -#endif -#ifdef OLWM_HINTS -# include "openlook.h" -#endif extern Atom _XA_WM_DELETE_WINDOW; extern Time LastTimestamp; @@ -105,9 +99,6 @@ Shutdown(WShutdownMode mode) #endif wSessionSaveClients(scr); -#ifdef KWM_HINTS - wKWMShutdown(scr, True); -#endif wScreenSaveState(scr); if (mode == WSKillMode) @@ -128,14 +119,7 @@ Shutdown(WShutdownMode mode) if (scr) { if (scr->helper_pid) kill(scr->helper_pid, SIGKILL); -#ifdef KWM_HINTS - wKWMShutdown(scr, False); -#endif -#ifdef OLWM_HINTS - wOLWMShutdown(scr); -#endif wScreenSaveState(scr); - RestoreDesktop(scr); } } diff --git a/src/startup.c b/src/startup.c index 5ee588ae..117f8c47 100644 --- a/src/startup.c +++ b/src/startup.c @@ -64,10 +64,6 @@ #include "xutil.h" -#ifdef KWM_HINTS -#include "kwm.h" -#endif - #if 0 #ifdef SYS_SIGLIST_DECLARED extern const char * const sys_siglist[]; @@ -882,10 +878,6 @@ StartUp(Bool defaultScreenOnly) } else { wSessionRestoreLastWorkspace(wScreen[j]); } - -#ifdef KWM_HINTS - wKWMSetInitializedHint(wScreen[j]); -#endif } if (wScreenCount == 0) { @@ -965,9 +957,6 @@ manageAllWindows(WScreen *scr, int crashRecovery) if (children[i] == None) continue; -#ifdef KWM_HINTS - wKWMCheckModule(scr, children[i]); -#endif wwin = wManageWindow(scr, children[i]); if (wwin) { /* apply states got from WSavedState */ diff --git a/src/wconfig.h.in b/src/wconfig.h.in index b6f86224..2fa8b559 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -68,9 +68,7 @@ /* * support for XDND drop in the Dock. Experimental */ -#ifdef GNOME_STUFF -#define XDND -#endif +/*#define XDND*/ /* * support for Motif window manager (mwm) window hints @@ -534,12 +532,7 @@ #define MAX_ICON_WIDTH 60 /* size of the icon pixmap */ #define MAX_ICON_HEIGHT 48 -/* KDE may have problems with more than 32 workspaces */ -#ifdef KWM_HINTS -# define MAX_WORKSPACES 32 -#else -# define MAX_WORKSPACES 100 -#endif +#define MAX_WORKSPACES 100 #define MAX_MENU_TEXT_LENGTH 512 diff --git a/src/window.c b/src/window.c index f5576eca..96bb7187 100644 --- a/src/window.c +++ b/src/window.c @@ -59,15 +59,6 @@ #ifdef MWM_HINTS # include "motif.h" #endif -#ifdef KWM_HINTS -# include "kwm.h" -#endif -#ifdef GNOME_STUFF -# include "gnome.h" -#endif -#ifdef OLWM_HINTS -# include "openlook.h" -#endif #ifdef NETWM_HINTS # include "wmspec.h" #endif @@ -443,20 +434,6 @@ wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) check = wNETWMCheckClientHints(wwin, &tmp_level, &tmp_workspace); #endif -#ifdef GNOME_STUFF - if (!check) - check = wGNOMECheckClientHints(wwin, &tmp_level, &tmp_workspace); -#endif /* GNOME_STUFF */ - -#ifdef KWM_HINTS - if (!check) - check = wKWMCheckClientHints(wwin, &tmp_level, &tmp_workspace); -#endif /* KWM_HINTS */ - -#ifdef OLWM_HINTS - wOLWMCheckClientHints(wwin); -#endif /* OLWM_HINTS */ - /* window levels are between INT_MIN+1 and INT_MAX, so if we still * have INT_MIN that means that no window level was requested. -Dan */ @@ -749,15 +726,6 @@ wManageWindow(WScreen *scr, Window window) title = NULL; } -#ifdef KWM_HINTS - if (title && !wKWMManageableClient(scr, window, title)) { - XFree(title); - XUngrabServer(dpy); - return NULL; - } -#endif /* KWM_HINTS */ - - wwin = wWindowCreate(); XSaveContext(dpy, window, wWinContext, (XPointer)&wwin->client_descriptor); @@ -882,24 +850,6 @@ wManageWindow(WScreen *scr, Window window) wWindowSetupInitialAttributes(wwin, &window_level, &workspace); -#ifdef OLWM_HINTS - if (wwin->client_flags.olwm_transient && wwin->transient_for==None - && wwin->group_id != None && wwin->group_id != window) { - - transientOwner = wWindowFor(wwin->group_id); - - if (transientOwner) { - wwin->transient_for = wwin->group_id; - - /* transients can't be iconified or maximized */ - if (wwin->transient_for) { - WSETUFLAG(wwin, no_miniaturizable, 1); - WSETUFLAG(wwin, no_miniaturize_button, 1); - } - } - } -#endif /* OLWM_HINTS */ - /* Make broken apps behave as a nice app. */ if (WFLAGP(wwin, emulate_appicon)) { wwin->main_window = wwin->client_win; @@ -1023,24 +973,9 @@ wManageWindow(WScreen *scr, Window window) wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL; } - { -#if defined(NETWM_HINTS) || defined(GNOME_STUFF) || defined(KWM_HINTS) - Bool bla = False; -#endif - #ifdef NETWM_HINTS - if (!bla) - bla = wNETWMCheckInitialClientState(wwin); + wNETWMCheckInitialClientState(wwin); #endif -#ifdef GNOME_STUFF - if (!bla) - bla = wGNOMECheckInitialClientState(wwin); -#endif -#ifdef KWM_HINTS - if (!bla) - bla = wKWMCheckClientInitialState(wwin); -#endif - } /* apply previous state if it exists and we're in startup */ if (scr->flags.startup && wm_state >= 0) { @@ -1371,16 +1306,6 @@ wManageWindow(WScreen *scr, Window window) wwin->frame->child = wwin; -#ifdef OLWM_HINTS - /* emulate olwm push pin. Make the button look as pushed-in for - * the pinned-out state. When the button is clicked, it will - * revert to the normal position, which means the pin is pinned-in. - */ - if (wwin->flags.olwm_push_pin_out) - wFrameWindowUpdatePushButton(wwin->frame, True); -#endif /* OLWM_HINTS */ - - wwin->frame->workspace = workspace; wwin->frame->on_click_left = windowIconifyClick; @@ -1611,16 +1536,6 @@ wManageWindow(WScreen *scr, Window window) wColormapInstallForWindow(scr, scr->cmap_window); -#ifdef OLWM_HINTS - if (wwin->client_flags.olwm_warp_to_pin && wwin->frame->titlebar != NULL - && !WFLAGP(wwin, no_close_button) && !withdraw) { - - XWarpPointer(dpy, None, None, 0, 0, 0, 0, - wwin->frame_x + width - wwin->frame->titlebar->height * 2, - wwin->frame_y); - } -#endif - /* *------------------------------------------------------------ * Setup Notification Observers @@ -2328,9 +2243,6 @@ wWindowSynthConfigureNotify(WWindow *wwin) sevent.xconfigure.override_redirect = False; XSendEvent(dpy, wwin->client_win, False, StructureNotifyMask, &sevent); -#ifdef KWM_HINTS - wKWMSendEventMessage(wwin, WKWMChangedClient); -#endif XFlush(dpy); } @@ -3354,18 +3266,6 @@ windowCloseClick(WCoreWindow *sender, void *data, XEvent *event) if (event->xbutton.state & ControlMask) { wClientKill(wwin); } else { -#ifdef OLWM_HINTS - if (wwin->flags.olwm_push_pin_out) { - - wwin->flags.olwm_push_pin_out = 0; - - wOLWMChangePushpinState(wwin, True); - - wFrameWindowUpdatePushButton(wwin->frame, False); - - return; - } -#endif if (wwin->protocols.DELETE_WINDOW && event->xbutton.state==0) { /* send delete message */ wClientSendProtocol(wwin, _XA_WM_DELETE_WINDOW, LastTimestamp); diff --git a/src/window.h b/src/window.h index 5d7651be..c696175b 100644 --- a/src/window.h +++ b/src/window.h @@ -146,12 +146,6 @@ typedef struct { */ unsigned int emulate_appicon:1; - /* toolkit specific attribute flags. These are unchangeable and - * unconfigurable and must not be saved as state. */ -#ifdef OLWM_HINTS - unsigned int olwm_transient:1; - unsigned int olwm_warp_to_pin:1; -#endif } WWindowAttributes; @@ -250,10 +244,6 @@ typedef struct WWindow { FocusMode focus_mode; /* type of keyboard input focus */ -#ifdef OLWM_HINTS_unfinished - struct WOLWindowState ol_window_state; -#endif - long event_mask; /* the event mask thats selected */ #ifdef MONITOR_HEARTBEAT @@ -309,15 +299,6 @@ typedef struct WWindow { unsigned int user_changed_height:1; unsigned int wm_name_changed:1; -#ifdef KWM_HINTS - unsigned int kwm_hidden_for_modules:1; - unsigned int kwm_managed:1; - unsigned int kwm_menubar:1; -#endif -#ifdef OLWM_HINTS - unsigned int olwm_push_pin_out:1;/* emulate pushpin behaviour */ - unsigned int olwm_limit_menu:1; -#endif #ifdef NETWM_HINTS unsigned int net_state_from_client:1; /* state hint was set by client */ unsigned int net_skip_pager:1; diff --git a/src/workspace.c b/src/workspace.c index 961354ac..2ff87afd 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -47,9 +47,6 @@ #include "actions.h" #include "workspace.h" #include "appicon.h" -#ifdef KWM_HINTS -#include "kwm.h" -#endif #ifdef NETWM_HINTS #include "wmspec.h" #endif @@ -105,11 +102,6 @@ wWorkspaceNew(WScreen *scr) wspace = wmalloc(sizeof(WWorkspace)); wspace->name = NULL; -#ifdef KWM_HINTS - if (scr->flags.kwm_syncing_count) { - wspace->name = wKWMGetWorkspaceName(scr, scr->workspace_count-1); - } -#endif if (!wspace->name) { wspace->name = wmalloc(strlen(_("Workspace %i"))+8); sprintf(wspace->name, _("Workspace %i"), scr->workspace_count); @@ -635,10 +627,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace) } } -#if defined KWM_HINTS || defined NETWM_HINTS - wScreenUpdateUsableArea(scr); -#endif #ifdef NETWM_HINTS + wScreenUpdateUsableArea(scr); wNETWMUpdateDesktop(scr); #endif