From: "Rodolfo García Peñas (kix)" <[email protected]>
The function wScreenSearchForRootWindow is exactly like wScreenForRootWindow
so can be removed swapping the function call.
---
src/event.c | 4 ++--
src/screen.h | 1 -
src/startup.c | 21 ---------------------
3 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/src/event.c b/src/event.c
index 2da0988..302497b 100644
--- a/src/event.c
+++ b/src/event.c
@@ -944,7 +944,7 @@ static void handleClientMessage(XEvent * event)
if (!wwin->flags.miniaturized)
wIconifyWindow(wwin);
} else if (event->xclient.message_type == _XA_WM_COLORMAP_NOTIFY &&
event->xclient.format == 32) {
- WScreen *scr =
wScreenSearchForRootWindow(event->xclient.window);
+ WScreen *scr = wScreenForRootWindow(event->xclient.window);
if (!scr)
return;
@@ -1034,7 +1034,7 @@ static void handleClientMessage(XEvent * event)
break;
}
} else if (event->xclient.message_type == _XA_WM_IGNORE_FOCUS_EVENTS) {
- WScreen *scr =
wScreenSearchForRootWindow(event->xclient.window);
+ WScreen *scr = wScreenForRootWindow(event->xclient.window);
if (!scr)
return;
scr->flags.ignore_focus_events = event->xclient.data.l[0] ? 1 :
0;
diff --git a/src/screen.h b/src/screen.h
index b2c2f42..5bf508e 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -313,7 +313,6 @@ int wScreenKeepInside(WScreen *scr, int *x, int *y, int
width, int height);
/* in startup.c */
WScreen *wScreenWithNumber(int i);
WScreen *wScreenForRootWindow(Window window); /* window must be valid */
-WScreen *wScreenSearchForRootWindow(Window window);
WScreen *wScreenForWindow(Window window); /* slower than above functions */
void wScreenFinish(WScreen *scr);
diff --git a/src/startup.c b/src/startup.c
index 93b5fe7..e0249ee 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -429,27 +429,6 @@ WScreen *wScreenForRootWindow(Window window)
return wScreenForWindow(window);
}
-WScreen *wScreenSearchForRootWindow(Window window)
-{
- int i;
-
- if (wScreenCount == 1)
- return wScreen[0];
-
- /*
- * Since the number of heads will probably be small (normally 2),
- * it should be faster to use this than a hash table, because
- * of the overhead.
- */
- for (i = 0; i < wScreenCount; i++) {
- if (wScreen[i]->root_win == window) {
- return wScreen[i];
- }
- }
-
- return wScreenForWindow(window);
-}
-
WScreen *wScreenForWindow(Window window)
{
XWindowAttributes attr;
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].