Permalink
Browse files

Remove secondary strcmp as per prior commit and assimilate duplicate …

…code into a single function
  • Loading branch information...
1 parent 67c7f7e commit aa39f34bf573c3261883185fc5c5ae026a73a074 @clivecrous committed Feb 22, 2012
Showing with 5 additions and 8 deletions.
  1. +5 −8 src/screen.c
View
@@ -19,22 +19,19 @@ static Window create_info_window(Client *client);
static void update_info_window(Client *c, Window info_window);
static void grab_keysym(Window w, unsigned int mask, KeySym keysym);
-/* is client on screen, and same vdesk (==client visible) */
-int is_client_on_screen(Client *c, ScreenInfo *s) {
+/* is client on screen, ignoring vdesk */
+int is_client_on_screen_vdesk(Client *c, ScreenInfo *s) {
if ( c->xstuff->screen != s ) return 0;
if ( c->xstuff->screen->display != s->display ) return 0;
- if ( c->virtual_desktop != s->virtual_desktop ) return 0;
return 1;
}
-/* is client on screen, ignoring vdesk */
-int is_client_on_screen_vdesk(Client *c, ScreenInfo *s) {
- if ( c->xstuff->screen != s ) return 0;
- if ( strcmp(c->xstuff->screen->display, s->display) ) return 0;
+/* is client on screen, and same vdesk (==client visible) */
+int is_client_on_screen(Client *c, ScreenInfo *s) {
+ if ( !is_client_on_screen_vdesk( c, s ) || ( c->virtual_desktop != s->virtual_desktop ) ) return 0;
return 1;
}
-
void remove_text_window(Window window);
void remove_text_window(Window window) {
if ( window ) XDestroyWindow(dpy, window);

0 comments on commit aa39f34

Please sign in to comment.