]>
code.delx.au - spectrwm/blob - scrotwm.c
3 * Copyright (c) 2009 Marco Peereboom <marco@peereboom.us>
4 * Copyright (c) 2009 Ryan McBride <mcbride@countersiege.com>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 * Much code and ideas taken from dwm under the following license:
20 * MIT/X Consortium License
22 * 2006-2008 Anselm R Garbe <garbeam at gmail dot com>
23 * 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
24 * 2006-2007 Jukka Salmi <jukka at salmi dot ch>
25 * 2007 Premysl Hruby <dfenze at gmail dot com>
26 * 2007 Szabolcs Nagy <nszabolcs at gmail dot com>
27 * 2007 Christof Musik <christof at sendfax dot de>
28 * 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
29 * 2007-2008 Peter Hartlich <sgkkr at hartlich dot com>
30 * 2008 Martin Hurton <martin dot hurton at gmail dot com>
32 * Permission is hereby granted, free of charge, to any person obtaining a
33 * copy of this software and associated documentation files (the "Software"),
34 * to deal in the Software without restriction, including without limitation
35 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
36 * and/or sell copies of the Software, and to permit persons to whom the
37 * Software is furnished to do so, subject to the following conditions:
39 * The above copyright notice and this permission notice shall be included in
40 * all copies or substantial portions of the Software.
42 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
45 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
47 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
48 * DEALINGS IN THE SOFTWARE.
51 #define SWM_VERSION "0.5"
61 #include <sys/types.h>
63 #include <sys/queue.h>
65 #include <X11/cursorfont.h>
66 #include <X11/keysym.h>
67 #include <X11/Xatom.h>
69 #include <X11/Xproto.h>
70 #include <X11/Xutil.h>
72 /* #define SWM_DEBUG */
74 #define DPRINTF(x...) do { if (swm_debug) fprintf(stderr, x); } while(0)
75 #define DNPRINTF(n,x...) do { if (swm_debug & n) fprintf(stderr, x); } while(0)
76 #define SWM_D_EVENT 0x0001
77 #define SWM_D_WS 0x0002
78 #define SWM_D_FOCUS 0x0004
79 #define SWM_D_MISC 0x0008
81 uint32_t swm_debug
= 0
89 #define DNPRINTF(n,x...)
92 #define LENGTH(x) (sizeof x / sizeof x[0])
93 #define MODKEY Mod1Mask
94 #define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
96 int (*xerrorxlib
)(Display
*, XErrorEvent
*);
101 int ignore_enter
= 0;
102 unsigned int numlockmask
= 0;
103 unsigned long col_focus
= 0xff0000; /* XXX should this be per ws? */
104 unsigned long col_unfocus
= 0x888888;
118 TAILQ_ENTRY(ws_win
) entry
;
126 TAILQ_HEAD(ws_win_list
, ws_win
);
128 /* define work spaces */
129 #define SWM_WS_MAX (10)
131 int visible
; /* workspace visible */
132 int restack
; /* restack on switch */
133 struct ws_win
*focus
; /* which win has focus */
134 int winno
; /* total nr of windows */
135 struct ws_win_list winlist
; /* list of windows in ws */
139 /* args to functions */
142 #define SWM_ARG_ID_FOCUSNEXT (0)
143 #define SWM_ARG_ID_FOCUSPREV (1)
144 #define SWM_ARG_ID_FOCUSMAIN (2)
158 XSetForeground(display
, bar_gc
, 0x000000);
159 XDrawString(display
, bar_window
, bar_gc
, 4, bar_fs
->ascent
, bar_text
,
164 localtime_r(&tmt
, &tm
);
165 strftime(bar_text
, sizeof bar_text
, "%a %b %d %R %Z %Y", &tm
);
166 XSetForeground(display
, bar_gc
, 0xa0a0a0);
167 XDrawString(display
, bar_window
, bar_gc
, 4, bar_fs
->ascent
, bar_text
,
169 XSync(display
, False
);
172 quit(union arg
*args
)
174 DNPRINTF(SWM_D_MISC
, "quit\n");
179 spawn(union arg
*args
)
181 DNPRINTF(SWM_D_MISC
, "spawn: %s\n", args
->argv
[0]);
183 * The double-fork construct avoids zombie processes and keeps the code
184 * clean from stupid signal handlers.
189 close(ConnectionNumber(display
));
191 execvp(args
->argv
[0], args
->argv
);
192 fprintf(stderr
, "execvp failed\n");
201 focus_win(struct ws_win
*win
)
203 DNPRINTF(SWM_D_FOCUS
, "focus_win: id: %lu\n", win
->id
);
204 XSetWindowBorder(display
, win
->id
, col_focus
);
205 XSetInputFocus(display
, win
->id
, RevertToPointerRoot
, CurrentTime
);
206 ws
[current_ws
].focus
= win
;
210 unfocus_win(struct ws_win
*win
)
212 DNPRINTF(SWM_D_FOCUS
, "unfocus_win: id: %lu\n", win
->id
);
213 XSetWindowBorder(display
, win
->id
, col_unfocus
);
214 if (ws
[current_ws
].focus
== win
)
215 ws
[current_ws
].focus
= NULL
;
219 switchws(union arg
*args
)
224 DNPRINTF(SWM_D_WS
, "switchws: %d\n", wsid
+ 1);
226 if (wsid
== current_ws
)
229 /* map new window first to prevent ugly blinking */
230 TAILQ_FOREACH (win
, &ws
[wsid
].winlist
, entry
)
231 XMapWindow(display
, win
->id
);
232 ws
[wsid
].visible
= 1;
234 TAILQ_FOREACH (win
, &ws
[current_ws
].winlist
, entry
)
235 XUnmapWindow(display
, win
->id
);
236 ws
[current_ws
].visible
= 0;
241 if (ws
[wsid
].restack
) {
244 if (ws
[wsid
].focus
!= NULL
)
245 focus_win(ws
[wsid
].focus
);
246 XSync(display
, False
);
251 focus(union arg
*args
)
253 struct ws_win
*winfocus
, *winlostfocus
;
255 DNPRINTF(SWM_D_FOCUS
, "focus: id %d\n", args
->id
);
256 if (ws
[current_ws
].focus
== NULL
|| ws
[current_ws
].winno
== 0)
259 winlostfocus
= ws
[current_ws
].focus
;
262 case SWM_ARG_ID_FOCUSPREV
:
263 if (ws
[current_ws
].focus
==
264 TAILQ_FIRST(&ws
[current_ws
].winlist
))
265 ws
[current_ws
].focus
=
266 TAILQ_LAST(&ws
[current_ws
].winlist
, ws_win_list
);
268 ws
[current_ws
].focus
=TAILQ_PREV(ws
[current_ws
].focus
,
272 case SWM_ARG_ID_FOCUSNEXT
:
273 if (ws
[current_ws
].focus
== TAILQ_LAST(&ws
[current_ws
].winlist
,
275 ws
[current_ws
].focus
=
276 TAILQ_FIRST(&ws
[current_ws
].winlist
);
278 ws
[current_ws
].focus
=
279 TAILQ_NEXT(ws
[current_ws
].focus
, entry
);
282 case SWM_ARG_ID_FOCUSMAIN
:
283 ws
[current_ws
].focus
= TAILQ_FIRST(&ws
[current_ws
].winlist
);;
290 winfocus
= ws
[current_ws
].focus
;
291 unfocus_win(winlostfocus
);
293 XSync(display
, False
);
296 /* I know this sucks but it works well enough */
301 struct ws_win wf
, *win
, *winfocus
= &wf
;
302 int i
, h
, w
, x
, y
, hrh
;
304 DNPRINTF(SWM_D_EVENT
, "stack: workspace: %d\n", current_ws
);
308 if (ws
[current_ws
].winno
== 0)
311 if (ws
[current_ws
].winno
> 1)
316 if (ws
[current_ws
].winno
> 2)
317 hrh
= height
/ (ws
[current_ws
].winno
- 1);
325 TAILQ_FOREACH (win
, &ws
[current_ws
].winlist
, entry
) {
330 if (i
!= 0 && hrh
!= 0) {
331 /* correct the last window for lost pixels */
332 if (win
== TAILQ_LAST(&ws
[current_ws
].winlist
,
334 h
= height
- (i
* hrh
);
342 /* leave first right hand window at y = 0 */
348 bzero(&wc
, sizeof wc
);
351 win
->width
= wc
.width
= w
;
352 win
->height
= wc
.height
= h
;
354 XConfigureWindow(display
, win
->id
, CWX
| CWY
| CWWidth
|
355 CWHeight
| CWBorderWidth
, &wc
);
356 if (win
== ws
[current_ws
].focus
)
360 XMapWindow(display
, win
->id
);
364 focus_win(winfocus
); /* this has to be done outside of the loop */
365 XSync(display
, False
);
369 swap_to_main(union arg
*args
)
371 struct ws_win
*tmpwin
= TAILQ_FIRST(&ws
[current_ws
].winlist
);
373 DNPRINTF(SWM_D_MISC
, "swap_to_main: win: %lu\n",
374 ws
[current_ws
].focus
->id
);
376 TAILQ_REMOVE(&ws
[current_ws
].winlist
, tmpwin
, entry
);
377 TAILQ_INSERT_AFTER(&ws
[current_ws
].winlist
, ws
[current_ws
].focus
,
379 TAILQ_REMOVE(&ws
[current_ws
].winlist
, ws
[current_ws
].focus
, entry
);
380 TAILQ_INSERT_HEAD(&ws
[current_ws
].winlist
, ws
[current_ws
].focus
, entry
);
381 ws
[current_ws
].focus
= TAILQ_FIRST(&ws
[current_ws
].winlist
);
387 send_to_ws(union arg
*args
)
390 struct ws_win
*win
= ws
[current_ws
].focus
;
392 DNPRINTF(SWM_D_MISC
, "send_to_ws: win: %lu\n", win
->id
);
394 XUnmapWindow(display
, win
->id
);
396 /* find a window to focus */
397 ws
[current_ws
].focus
= TAILQ_PREV(win
, ws_win_list
,entry
);
398 if (ws
[current_ws
].focus
== NULL
)
399 ws
[current_ws
].focus
= TAILQ_FIRST(&ws
[current_ws
].winlist
);
401 TAILQ_REMOVE(&ws
[current_ws
].winlist
, win
, entry
);
402 ws
[current_ws
].winno
--;
404 TAILQ_INSERT_TAIL(&ws
[wsid
].winlist
, win
, entry
);
405 if (ws
[wsid
].winno
== 0)
406 ws
[wsid
].focus
= win
;
408 ws
[wsid
].restack
= 1;
414 /* terminal + args */
415 char *term
[] = { "xterm", NULL
};
417 /* key definitions */
421 void (*func
)(union arg
*);
424 /* modifier key function argument */
425 { MODKEY
, XK_Return
, swap_to_main
, {0} },
426 { MODKEY
| ShiftMask
, XK_Return
, spawn
, {.argv
= term
} },
427 { MODKEY
| ShiftMask
, XK_q
, quit
, {0} },
428 { MODKEY
, XK_m
, focus
, {.id
= SWM_ARG_ID_FOCUSMAIN
} },
429 { MODKEY
, XK_1
, switchws
, {.id
= 0} },
430 { MODKEY
, XK_2
, switchws
, {.id
= 1} },
431 { MODKEY
, XK_3
, switchws
, {.id
= 2} },
432 { MODKEY
, XK_4
, switchws
, {.id
= 3} },
433 { MODKEY
, XK_5
, switchws
, {.id
= 4} },
434 { MODKEY
, XK_6
, switchws
, {.id
= 5} },
435 { MODKEY
, XK_7
, switchws
, {.id
= 6} },
436 { MODKEY
, XK_8
, switchws
, {.id
= 7} },
437 { MODKEY
, XK_9
, switchws
, {.id
= 8} },
438 { MODKEY
, XK_0
, switchws
, {.id
= 9} },
439 { MODKEY
| ShiftMask
, XK_1
, send_to_ws
, {.id
= 0} },
440 { MODKEY
| ShiftMask
, XK_2
, send_to_ws
, {.id
= 1} },
441 { MODKEY
| ShiftMask
, XK_3
, send_to_ws
, {.id
= 2} },
442 { MODKEY
| ShiftMask
, XK_4
, send_to_ws
, {.id
= 3} },
443 { MODKEY
| ShiftMask
, XK_5
, send_to_ws
, {.id
= 4} },
444 { MODKEY
| ShiftMask
, XK_6
, send_to_ws
, {.id
= 5} },
445 { MODKEY
| ShiftMask
, XK_7
, send_to_ws
, {.id
= 6} },
446 { MODKEY
| ShiftMask
, XK_8
, send_to_ws
, {.id
= 7} },
447 { MODKEY
| ShiftMask
, XK_9
, send_to_ws
, {.id
= 8} },
448 { MODKEY
| ShiftMask
, XK_0
, send_to_ws
, {.id
= 9} },
449 { MODKEY
, XK_Tab
, focus
, {.id
= SWM_ARG_ID_FOCUSPREV
} },
450 { MODKEY
| ShiftMask
, XK_Tab
, focus
, {.id
= SWM_ARG_ID_FOCUSNEXT
} },
451 { MODKEY
| ShiftMask
, XK_Tab
, focus
, {.id
= SWM_ARG_ID_FOCUSPREV
} },
455 updatenumlockmask(void)
458 XModifierKeymap
*modmap
;
460 DNPRINTF(SWM_D_MISC
, "updatenumlockmask\n");
462 modmap
= XGetModifierMapping(display
);
463 for (i
= 0; i
< 8; i
++)
464 for (j
= 0; j
< modmap
->max_keypermod
; j
++)
465 if (modmap
->modifiermap
[i
* modmap
->max_keypermod
+ j
]
466 == XKeysymToKeycode(display
, XK_Num_Lock
))
467 numlockmask
= (1 << i
);
469 XFreeModifiermap(modmap
);
477 unsigned int modifiers
[] =
478 { 0, LockMask
, numlockmask
, numlockmask
| LockMask
};
480 DNPRINTF(SWM_D_MISC
, "grabkeys\n");
483 XUngrabKey(display
, AnyKey
, AnyModifier
, root
);
484 for(i
= 0; i
< LENGTH(keys
); i
++) {
485 if((code
= XKeysymToKeycode(display
, keys
[i
].keysym
)))
486 for(j
= 0; j
< LENGTH(modifiers
); j
++)
487 XGrabKey(display
, code
,
488 keys
[i
].mod
| modifiers
[j
], root
,
489 True
, GrabModeAsync
, GrabModeAsync
);
495 DNPRINTF(SWM_D_EVENT
, "expose: window: %lu\n", e
->xexpose
.window
);
503 XKeyEvent
*ev
= &e
->xkey
;
505 DNPRINTF(SWM_D_EVENT
, "keypress: window: %lu\n", ev
->window
);
507 keysym
= XKeycodeToKeysym(display
, (KeyCode
)ev
->keycode
, 0);
508 for(i
= 0; i
< LENGTH(keys
); i
++)
509 if(keysym
== keys
[i
].keysym
510 && CLEANMASK(keys
[i
].mod
) == CLEANMASK(ev
->state
)
512 keys
[i
].func(&(keys
[i
].args
));
516 buttonpress(XEvent
*e
)
518 XButtonPressedEvent
*ev
= &e
->xbutton
;
519 #ifdef SWM_CLICKTOFOCUS
524 DNPRINTF(SWM_D_EVENT
, "buttonpress: window: %lu\n", ev
->window
);
526 if (ev
->window
== root
)
528 if (ev
->window
== ws
[current_ws
].focus
->id
)
530 #ifdef SWM_CLICKTOFOCUS
531 TAILQ_FOREACH(win
, &ws
[current_ws
].winlist
, entry
)
532 if (win
->id
== ev
->window
) {
533 /* focus in the clicked window */
534 XSetWindowBorder(display
, ev
->window
, 0xff0000);
535 XSetWindowBorder(display
,
536 ws
[current_ws
].focus
->id
, 0x888888);
537 XSetInputFocus(display
, ev
->window
, RevertToPointerRoot
,
539 ws
[current_ws
].focus
= win
;
540 XSync(display
, False
);
547 configurerequest(XEvent
*e
)
549 XConfigureRequestEvent
*ev
= &e
->xconfigurerequest
;
552 DNPRINTF(SWM_D_EVENT
, "configurerequest: window: %lu\n", ev
->window
);
554 XSelectInput(display
, ev
->window
, ButtonPressMask
| EnterWindowMask
|
557 if ((win
= calloc(1, sizeof(struct ws_win
))) == NULL
)
558 errx(1, "calloc: failed to allocate memory for new window");
560 win
->id
= ev
->window
;
561 TAILQ_INSERT_TAIL(&ws
[current_ws
].winlist
, win
, entry
);
562 ws
[current_ws
].focus
= win
; /* make new win focused */
563 ws
[current_ws
].winno
++;
568 configurenotify(XEvent
*e
)
570 DNPRINTF(SWM_D_EVENT
, "configurenotify: window: %lu\n",
571 e
->xconfigure
.window
);
575 destroynotify(XEvent
*e
)
578 XDestroyWindowEvent
*ev
= &e
->xdestroywindow
;
580 DNPRINTF(SWM_D_EVENT
, "destroynotify: window %lu\n", ev
->window
);
582 TAILQ_FOREACH (win
, &ws
[current_ws
].winlist
, entry
) {
583 if (ev
->window
== win
->id
) {
584 /* find a window to focus */
585 ws
[current_ws
].focus
=
586 TAILQ_PREV(win
, ws_win_list
,entry
);
587 if (ws
[current_ws
].focus
== NULL
)
588 ws
[current_ws
].focus
=
589 TAILQ_FIRST(&ws
[current_ws
].winlist
);
591 TAILQ_REMOVE(&ws
[current_ws
].winlist
, win
, entry
);
593 ws
[current_ws
].winno
--;
602 enternotify(XEvent
*e
)
604 XCrossingEvent
*ev
= &e
->xcrossing
;
607 DNPRINTF(SWM_D_EVENT
, "enternotify: window: %lu\n", ev
->window
);
609 if((ev
->mode
!= NotifyNormal
|| ev
->detail
== NotifyInferior
) &&
613 /* eat event(s) to prevent autofocus */
617 TAILQ_FOREACH (win
, &ws
[current_ws
].winlist
, entry
) {
618 if (win
->id
== ev
->window
)
628 XFocusChangeEvent
*ev
= &e
->xfocus
;
630 DNPRINTF(SWM_D_EVENT
, "focusin: window: %lu\n", ev
->window
);
632 if (ev
->window
== root
)
636 * kill grab for now so that we can cut and paste , this screws up
640 DNPRINTF(SWM_D_EVENT, "focusin: window: %lu grabbing\n", ev->window);
641 XGrabButton(display, Button1, AnyModifier, ev->window, False,
642 ButtonPress, GrabModeAsync, GrabModeSync, None, None);
647 mappingnotify(XEvent
*e
)
649 XMappingEvent
*ev
= &e
->xmapping
;
651 DNPRINTF(SWM_D_EVENT
, "mappingnotify: window: %lu\n", ev
->window
);
653 XRefreshKeyboardMapping(ev
);
654 if(ev
->request
== MappingKeyboard
)
659 maprequest(XEvent
*e
)
661 DNPRINTF(SWM_D_EVENT
, "maprequest: window: %lu\n",
662 e
->xmaprequest
.window
);
666 propertynotify(XEvent
*e
)
668 DNPRINTF(SWM_D_EVENT
, "propertynotify: window: %lu\n",
669 e
->xproperty
.window
);
673 unmapnotify(XEvent
*e
)
675 DNPRINTF(SWM_D_EVENT
, "unmapnotify: window: %lu\n", e
->xunmap
.window
);
678 void (*handler
[LASTEvent
])(XEvent
*) = {
680 [KeyPress
] = keypress
,
681 [ButtonPress
] = buttonpress
,
682 [ConfigureRequest
] = configurerequest
,
683 [ConfigureNotify
] = configurenotify
,
684 [DestroyNotify
] = destroynotify
,
685 [EnterNotify
] = enternotify
,
687 [MappingNotify
] = mappingnotify
,
688 [MapRequest
] = maprequest
,
689 [PropertyNotify
] = propertynotify
,
690 [UnmapNotify
] = unmapnotify
,
694 xerror_start(Display
*d
, XErrorEvent
*ee
)
701 xerror(Display
*d
, XErrorEvent
*ee
)
703 fprintf(stderr
, "error: %p %p\n", display
, ee
);
712 xerrorxlib
= XSetErrorHandler(xerror_start
);
714 /* this causes an error if some other window manager is running */
715 XSelectInput(display
, DefaultRootWindow(display
),
716 SubstructureRedirectMask
);
717 XSync(display
, False
);
721 XSetErrorHandler(xerror
);
722 XSync(display
, False
);
727 main(int argc
, char *argv
[])
732 fprintf(stderr
, "Welcome to scrotwm V%s\n", SWM_VERSION
);
733 if(!setlocale(LC_CTYPE
, "") || !XSupportsLocale())
734 warnx("no locale support");
736 if(!(display
= XOpenDisplay(0)))
737 errx(1, "can not open display");
740 errx(1, "other wm running");
742 screen
= DefaultScreen(display
);
743 root
= RootWindow(display
, screen
);
744 width
= DisplayWidth(display
, screen
) - 2;
745 height
= DisplayHeight(display
, screen
) - 2;
747 /* make work space 1 active */
752 TAILQ_INIT(&ws
[0].winlist
);
753 for (i
= 1; i
< SWM_WS_MAX
; i
++) {
758 TAILQ_INIT(&ws
[i
].winlist
);
761 /* setup status bar */
762 bar_fs
= XLoadQueryFont(display
,
763 "-*-terminus-*-*-*-*-*-*-*-*-*-*-*-*");
764 if (bar_fs
== NULL
) {
765 /* load a font that is default */
766 bar_fs
= XLoadQueryFont(display
,
767 "-*-times-medium-r-*-*-*-*-*-*-*-*-*-*");
769 errx(1, "couldn't load font");
771 bar_height
= bar_fs
->ascent
+ bar_fs
->descent
+ 3;
773 XSelectInput(display
, root
, SubstructureRedirectMask
|
774 SubstructureNotifyMask
| ButtonPressMask
| KeyPressMask
|
775 EnterWindowMask
| LeaveWindowMask
| StructureNotifyMask
|
776 FocusChangeMask
| PropertyChangeMask
);
780 bar_window
= XCreateSimpleWindow(display
, root
, 0, 0, width
,
781 bar_height
- 2, 1, 0x008080, 0x000000);
782 bar_gc
= XCreateGC(display
, bar_window
, 0, &bar_gcv
);
783 XSetFont(display
, bar_gc
, bar_fs
->fid
);
785 height
-= bar_height
; /* correct screen height */
786 XMapWindow(display
, bar_window
);
791 XNextEvent(display
, &e
);
796 XCloseDisplay(display
);