mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-20 09:43:32 +01:00
changed indentation to use spaces only
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* colormap.c - colormap handling code
|
||||
*
|
||||
*
|
||||
* Window Maker window manager
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1998-2003 Alfredo K. Kojima
|
||||
*
|
||||
* This code slightly based on fvwm code,
|
||||
*
|
||||
* This code slightly based on fvwm code,
|
||||
* Copyright (c) Rob Nation and others
|
||||
* but completely rewritten.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
#include "framewin.h"
|
||||
void
|
||||
void
|
||||
wColormapInstallForWindow(WScreen *scr, WWindow *wwin)
|
||||
{
|
||||
int i;
|
||||
@@ -41,69 +41,69 @@ wColormapInstallForWindow(WScreen *scr, WWindow *wwin)
|
||||
int done = 0;
|
||||
Window xwin = None;
|
||||
|
||||
|
||||
|
||||
if (wwin) {
|
||||
xwin = wwin->client_win;
|
||||
xwin = wwin->client_win;
|
||||
} else {
|
||||
xwin = scr->root_win;
|
||||
xwin = scr->root_win;
|
||||
}
|
||||
|
||||
scr->cmap_window = wwin;
|
||||
|
||||
if (scr->root_colormap_install_count > 0) {
|
||||
scr->original_cmap_window = wwin;
|
||||
return;
|
||||
scr->original_cmap_window = wwin;
|
||||
return;
|
||||
}
|
||||
|
||||
/* install colormap for all windows of the client */
|
||||
if (wwin && wwin->cmap_window_no > 0 && wwin->cmap_windows) {
|
||||
for (i = wwin->cmap_window_no - 1; i >= 0; i--) {
|
||||
Window w;
|
||||
for (i = wwin->cmap_window_no - 1; i >= 0; i--) {
|
||||
Window w;
|
||||
|
||||
w = wwin->cmap_windows[i];
|
||||
if (w == wwin->client_win)
|
||||
done = 1;
|
||||
w = wwin->cmap_windows[i];
|
||||
if (w == wwin->client_win)
|
||||
done = 1;
|
||||
|
||||
XGetWindowAttributes(dpy, w, &attributes);
|
||||
if (attributes.colormap == None)
|
||||
attributes.colormap = scr->colormap;
|
||||
XGetWindowAttributes(dpy, w, &attributes);
|
||||
if (attributes.colormap == None)
|
||||
attributes.colormap = scr->colormap;
|
||||
|
||||
if (scr->current_colormap != attributes.colormap) {
|
||||
scr->current_colormap = attributes.colormap;
|
||||
/*
|
||||
* ICCCM 2.0: some client requested permission
|
||||
* to install colormaps by itself and we granted.
|
||||
* So, we can't install any colormaps.
|
||||
*/
|
||||
if (!scr->flags.colormap_stuff_blocked)
|
||||
XInstallColormap(dpy, attributes.colormap);
|
||||
}
|
||||
}
|
||||
if (scr->current_colormap != attributes.colormap) {
|
||||
scr->current_colormap = attributes.colormap;
|
||||
/*
|
||||
* ICCCM 2.0: some client requested permission
|
||||
* to install colormaps by itself and we granted.
|
||||
* So, we can't install any colormaps.
|
||||
*/
|
||||
if (!scr->flags.colormap_stuff_blocked)
|
||||
XInstallColormap(dpy, attributes.colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!done) {
|
||||
attributes.colormap = None;
|
||||
if (xwin != None)
|
||||
XGetWindowAttributes(dpy, xwin, &attributes);
|
||||
if (attributes.colormap == None)
|
||||
attributes.colormap = scr->colormap;
|
||||
attributes.colormap = None;
|
||||
if (xwin != None)
|
||||
XGetWindowAttributes(dpy, xwin, &attributes);
|
||||
if (attributes.colormap == None)
|
||||
attributes.colormap = scr->colormap;
|
||||
|
||||
if (scr->current_colormap != attributes.colormap) {
|
||||
scr->current_colormap = attributes.colormap;
|
||||
if (!scr->flags.colormap_stuff_blocked)
|
||||
XInstallColormap(dpy, attributes.colormap);
|
||||
}
|
||||
if (scr->current_colormap != attributes.colormap) {
|
||||
scr->current_colormap = attributes.colormap;
|
||||
if (!scr->flags.colormap_stuff_blocked)
|
||||
XInstallColormap(dpy, attributes.colormap);
|
||||
}
|
||||
}
|
||||
XSync(dpy, False);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
wColormapInstallRoot(WScreen *scr)
|
||||
{
|
||||
if (scr->root_colormap_install_count == 0) {
|
||||
wColormapInstallForWindow(scr, NULL);
|
||||
scr->original_cmap_window = scr->cmap_window;
|
||||
wColormapInstallForWindow(scr, NULL);
|
||||
scr->original_cmap_window = scr->cmap_window;
|
||||
}
|
||||
scr->root_colormap_install_count++;
|
||||
}
|
||||
@@ -113,11 +113,11 @@ void
|
||||
wColormapUninstallRoot(WScreen *scr)
|
||||
{
|
||||
if (scr->root_colormap_install_count > 0)
|
||||
scr->root_colormap_install_count--;
|
||||
scr->root_colormap_install_count--;
|
||||
|
||||
if (scr->root_colormap_install_count == 0) {
|
||||
wColormapInstallForWindow(scr, scr->original_cmap_window);
|
||||
scr->original_cmap_window = NULL;
|
||||
wColormapInstallForWindow(scr, scr->original_cmap_window);
|
||||
scr->original_cmap_window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,13 +126,14 @@ void
|
||||
wColormapAllowClientInstallation(WScreen *scr, Bool starting)
|
||||
{
|
||||
scr->flags.colormap_stuff_blocked = starting;
|
||||
/*
|
||||
/*
|
||||
* Client stopped managing the colormap stuff. Restore the colormap
|
||||
* that would be installed if the client did not request colormap
|
||||
* stuff.
|
||||
*/
|
||||
if (!starting) {
|
||||
XInstallColormap(dpy, scr->current_colormap);
|
||||
XSync(dpy, False);
|
||||
XInstallColormap(dpy, scr->current_colormap);
|
||||
XSync(dpy, False);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user