balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | * QEMU curses/ncurses display driver |
| 3 | * |
| 4 | * Copyright (c) 2005 Andrzej Zaborowski <balrog@zabor.org> |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to deal |
| 8 | * in the Software without restriction, including without limitation the rights |
| 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | * copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in |
| 14 | * all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | * THE SOFTWARE. |
| 23 | */ |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 24 | #include <curses.h> |
| 25 | |
| 26 | #ifndef _WIN32 |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 27 | #include <sys/ioctl.h> |
| 28 | #include <termios.h> |
| 29 | #endif |
| 30 | |
blueswir1 | 511d2b1 | 2009-03-07 15:32:56 +0000 | [diff] [blame] | 31 | #include "qemu-common.h" |
Paolo Bonzini | 28ecbae | 2012-11-28 12:06:30 +0100 | [diff] [blame] | 32 | #include "ui/console.h" |
Paolo Bonzini | 9c17d61 | 2012-12-17 18:20:04 +0100 | [diff] [blame] | 33 | #include "sysemu/sysemu.h" |
blueswir1 | 511d2b1 | 2009-03-07 15:32:56 +0000 | [diff] [blame] | 34 | |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 35 | #define FONT_HEIGHT 16 |
| 36 | #define FONT_WIDTH 8 |
| 37 | |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 38 | static DisplayChangeListener *dcl; |
Anthony Liguori | c227f09 | 2009-10-01 16:12:16 -0500 | [diff] [blame] | 39 | static console_ch_t screen[160 * 100]; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 40 | static WINDOW *screenpad = NULL; |
| 41 | static int width, height, gwidth, gheight, invalidate; |
| 42 | static int px, py, sminx, sminy, smaxx, smaxy; |
| 43 | |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 44 | static void curses_update(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 45 | int x, int y, int w, int h) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 46 | { |
| 47 | chtype *line; |
| 48 | |
| 49 | line = ((chtype *) screen) + y * width; |
| 50 | for (h += y; y < h; y ++, line += width) |
| 51 | mvwaddchnstr(screenpad, y, 0, line, width); |
| 52 | |
| 53 | pnoutrefresh(screenpad, py, px, sminy, sminx, smaxy - 1, smaxx - 1); |
| 54 | refresh(); |
| 55 | } |
| 56 | |
| 57 | static void curses_calc_pad(void) |
| 58 | { |
Gerd Hoffmann | 81c0d5a | 2013-03-14 14:27:08 +0100 | [diff] [blame] | 59 | if (qemu_console_is_fixedsize(NULL)) { |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 60 | width = gwidth; |
| 61 | height = gheight; |
| 62 | } else { |
| 63 | width = COLS; |
| 64 | height = LINES; |
| 65 | } |
| 66 | |
| 67 | if (screenpad) |
| 68 | delwin(screenpad); |
| 69 | |
| 70 | clear(); |
| 71 | refresh(); |
| 72 | |
| 73 | screenpad = newpad(height, width); |
| 74 | |
| 75 | if (width > COLS) { |
| 76 | px = (width - COLS) / 2; |
| 77 | sminx = 0; |
| 78 | smaxx = COLS; |
| 79 | } else { |
| 80 | px = 0; |
| 81 | sminx = (COLS - width) / 2; |
| 82 | smaxx = sminx + width; |
| 83 | } |
| 84 | |
| 85 | if (height > LINES) { |
| 86 | py = (height - LINES) / 2; |
| 87 | sminy = 0; |
| 88 | smaxy = LINES; |
| 89 | } else { |
| 90 | py = 0; |
| 91 | sminy = (LINES - height) / 2; |
| 92 | smaxy = sminy + height; |
| 93 | } |
| 94 | } |
| 95 | |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 96 | static void curses_resize(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 97 | int width, int height) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 98 | { |
Gerd Hoffmann | a93a4a2 | 2012-09-28 15:02:08 +0200 | [diff] [blame] | 99 | if (width == gwidth && height == gheight) { |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 100 | return; |
Gerd Hoffmann | a93a4a2 | 2012-09-28 15:02:08 +0200 | [diff] [blame] | 101 | } |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 102 | |
Gerd Hoffmann | a93a4a2 | 2012-09-28 15:02:08 +0200 | [diff] [blame] | 103 | gwidth = width; |
| 104 | gheight = height; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 105 | |
| 106 | curses_calc_pad(); |
| 107 | } |
| 108 | |
| 109 | #ifndef _WIN32 |
balrog | b1314cf | 2008-02-22 18:21:28 +0000 | [diff] [blame] | 110 | #if defined(SIGWINCH) && defined(KEY_RESIZE) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 111 | static void curses_winch_handler(int signum) |
| 112 | { |
| 113 | struct winsize { |
| 114 | unsigned short ws_row; |
| 115 | unsigned short ws_col; |
| 116 | unsigned short ws_xpixel; /* unused */ |
| 117 | unsigned short ws_ypixel; /* unused */ |
| 118 | } ws; |
| 119 | |
| 120 | /* terminal size changed */ |
| 121 | if (ioctl(1, TIOCGWINSZ, &ws) == -1) |
| 122 | return; |
| 123 | |
| 124 | resize_term(ws.ws_row, ws.ws_col); |
| 125 | curses_calc_pad(); |
| 126 | invalidate = 1; |
| 127 | |
| 128 | /* some systems require this */ |
| 129 | signal(SIGWINCH, curses_winch_handler); |
| 130 | } |
| 131 | #endif |
| 132 | #endif |
| 133 | |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 134 | static void curses_cursor_position(DisplayChangeListener *dcl, |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 135 | int x, int y) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 136 | { |
| 137 | if (x >= 0) { |
| 138 | x = sminx + x - px; |
| 139 | y = sminy + y - py; |
| 140 | |
| 141 | if (x >= 0 && y >= 0 && x < COLS && y < LINES) { |
| 142 | move(y, x); |
| 143 | curs_set(1); |
| 144 | /* it seems that curs_set(1) must always be called before |
| 145 | * curs_set(2) for the latter to have effect */ |
Gerd Hoffmann | 81c0d5a | 2013-03-14 14:27:08 +0100 | [diff] [blame] | 146 | if (!qemu_console_is_graphic(NULL)) { |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 147 | curs_set(2); |
Gerd Hoffmann | 81c0d5a | 2013-03-14 14:27:08 +0100 | [diff] [blame] | 148 | } |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 149 | return; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | curs_set(0); |
| 154 | } |
| 155 | |
| 156 | /* generic keyboard conversion */ |
| 157 | |
| 158 | #include "curses_keys.h" |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 159 | |
Anthony Liguori | c227f09 | 2009-10-01 16:12:16 -0500 | [diff] [blame] | 160 | static kbd_layout_t *kbd_layout = NULL; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 161 | |
Gerd Hoffmann | bc2ed97 | 2013-03-01 13:03:04 +0100 | [diff] [blame] | 162 | static void curses_refresh(DisplayChangeListener *dcl) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 163 | { |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 164 | int chr, nextchr, keysym, keycode, keycode_alt; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 165 | |
| 166 | if (invalidate) { |
| 167 | clear(); |
| 168 | refresh(); |
| 169 | curses_calc_pad(); |
Gerd Hoffmann | 1dbfa00 | 2013-03-12 13:44:38 +0100 | [diff] [blame] | 170 | graphic_hw_invalidate(NULL); |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 171 | invalidate = 0; |
| 172 | } |
| 173 | |
Gerd Hoffmann | 1dbfa00 | 2013-03-12 13:44:38 +0100 | [diff] [blame] | 174 | graphic_hw_text_update(NULL, screen); |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 175 | |
| 176 | nextchr = ERR; |
| 177 | while (1) { |
| 178 | /* while there are any pending key strokes to process */ |
| 179 | if (nextchr == ERR) |
| 180 | chr = getch(); |
| 181 | else { |
| 182 | chr = nextchr; |
| 183 | nextchr = ERR; |
| 184 | } |
| 185 | |
| 186 | if (chr == ERR) |
| 187 | break; |
| 188 | |
balrog | b1314cf | 2008-02-22 18:21:28 +0000 | [diff] [blame] | 189 | #ifdef KEY_RESIZE |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 190 | /* this shouldn't occur when we use a custom SIGWINCH handler */ |
| 191 | if (chr == KEY_RESIZE) { |
| 192 | clear(); |
| 193 | refresh(); |
| 194 | curses_calc_pad(); |
Gerd Hoffmann | bc2ed97 | 2013-03-01 13:03:04 +0100 | [diff] [blame] | 195 | curses_update(dcl, 0, 0, width, height); |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 196 | continue; |
| 197 | } |
balrog | b1314cf | 2008-02-22 18:21:28 +0000 | [diff] [blame] | 198 | #endif |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 199 | |
| 200 | keycode = curses2keycode[chr]; |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 201 | keycode_alt = 0; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 202 | |
| 203 | /* alt key */ |
| 204 | if (keycode == 1) { |
| 205 | nextchr = getch(); |
| 206 | |
| 207 | if (nextchr != ERR) { |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 208 | chr = nextchr; |
| 209 | keycode_alt = ALT; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 210 | keycode = curses2keycode[nextchr]; |
| 211 | nextchr = ERR; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 212 | |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 213 | if (keycode != -1) { |
| 214 | keycode |= ALT; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 215 | |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 216 | /* process keys reserved for qemu */ |
| 217 | if (keycode >= QEMU_KEY_CONSOLE0 && |
| 218 | keycode < QEMU_KEY_CONSOLE0 + 9) { |
| 219 | erase(); |
| 220 | wnoutrefresh(stdscr); |
| 221 | console_select(keycode - QEMU_KEY_CONSOLE0); |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 222 | |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 223 | invalidate = 1; |
| 224 | continue; |
| 225 | } |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 230 | if (kbd_layout) { |
| 231 | keysym = -1; |
| 232 | if (chr < CURSES_KEYS) |
| 233 | keysym = curses2keysym[chr]; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 234 | |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 235 | if (keysym == -1) { |
Samuel Thibault | d03703c | 2010-10-19 19:48:20 +0200 | [diff] [blame] | 236 | if (chr < ' ') { |
| 237 | keysym = chr + '@'; |
| 238 | if (keysym >= 'A' && keysym <= 'Z') |
| 239 | keysym += 'a' - 'A'; |
| 240 | keysym |= KEYSYM_CNTRL; |
| 241 | } else |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 242 | keysym = chr; |
| 243 | } |
| 244 | |
| 245 | keycode = keysym2scancode(kbd_layout, keysym & KEYSYM_MASK); |
| 246 | if (keycode == 0) |
| 247 | continue; |
| 248 | |
| 249 | keycode |= (keysym & ~KEYSYM_MASK) >> 16; |
| 250 | keycode |= keycode_alt; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 251 | } |
| 252 | |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 253 | if (keycode == -1) |
| 254 | continue; |
| 255 | |
Gerd Hoffmann | 81c0d5a | 2013-03-14 14:27:08 +0100 | [diff] [blame] | 256 | if (qemu_console_is_graphic(NULL)) { |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 257 | /* since terminals don't know about key press and release |
| 258 | * events, we need to emit both for each key received */ |
| 259 | if (keycode & SHIFT) |
| 260 | kbd_put_keycode(SHIFT_CODE); |
| 261 | if (keycode & CNTRL) |
| 262 | kbd_put_keycode(CNTRL_CODE); |
| 263 | if (keycode & ALT) |
| 264 | kbd_put_keycode(ALT_CODE); |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 265 | if (keycode & ALTGR) { |
| 266 | kbd_put_keycode(SCANCODE_EMUL0); |
| 267 | kbd_put_keycode(ALT_CODE); |
| 268 | } |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 269 | if (keycode & GREY) |
| 270 | kbd_put_keycode(GREY_CODE); |
| 271 | kbd_put_keycode(keycode & KEY_MASK); |
| 272 | if (keycode & GREY) |
| 273 | kbd_put_keycode(GREY_CODE); |
| 274 | kbd_put_keycode((keycode & KEY_MASK) | KEY_RELEASE); |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 275 | if (keycode & ALTGR) { |
| 276 | kbd_put_keycode(SCANCODE_EMUL0); |
| 277 | kbd_put_keycode(ALT_CODE | KEY_RELEASE); |
| 278 | } |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 279 | if (keycode & ALT) |
| 280 | kbd_put_keycode(ALT_CODE | KEY_RELEASE); |
| 281 | if (keycode & CNTRL) |
| 282 | kbd_put_keycode(CNTRL_CODE | KEY_RELEASE); |
| 283 | if (keycode & SHIFT) |
| 284 | kbd_put_keycode(SHIFT_CODE | KEY_RELEASE); |
| 285 | } else { |
Samuel Thibault | 44bb61c | 2010-02-28 21:03:00 +0100 | [diff] [blame] | 286 | keysym = curses2qemu[chr]; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 287 | if (keysym == -1) |
| 288 | keysym = chr; |
| 289 | |
| 290 | kbd_put_keysym(keysym); |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | |
Blue Swirl | aaf12c2 | 2010-03-21 19:44:06 +0000 | [diff] [blame] | 295 | static void curses_atexit(void) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 296 | { |
| 297 | endwin(); |
| 298 | } |
| 299 | |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 300 | static void curses_setup(void) |
| 301 | { |
| 302 | int i, colour_default[8] = { |
| 303 | COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, |
| 304 | COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE, |
| 305 | }; |
| 306 | |
| 307 | /* input as raw as possible, let everything be interpreted |
| 308 | * by the guest system */ |
| 309 | initscr(); noecho(); intrflush(stdscr, FALSE); |
| 310 | nodelay(stdscr, TRUE); nonl(); keypad(stdscr, TRUE); |
| 311 | start_color(); raw(); scrollok(stdscr, FALSE); |
| 312 | |
| 313 | for (i = 0; i < 64; i ++) |
| 314 | init_pair(i, colour_default[i & 7], colour_default[i >> 3]); |
| 315 | } |
| 316 | |
| 317 | static void curses_keyboard_setup(void) |
| 318 | { |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 319 | #if defined(__APPLE__) |
| 320 | /* always use generic keymaps */ |
| 321 | if (!keyboard_layout) |
| 322 | keyboard_layout = "en-us"; |
| 323 | #endif |
| 324 | if(keyboard_layout) { |
aliguori | 0483755 | 2009-03-06 20:27:10 +0000 | [diff] [blame] | 325 | kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout); |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 326 | if (!kbd_layout) |
| 327 | exit(1); |
| 328 | } |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 329 | } |
| 330 | |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 331 | static const DisplayChangeListenerOps dcl_ops = { |
| 332 | .dpy_name = "curses", |
| 333 | .dpy_text_update = curses_update, |
| 334 | .dpy_text_resize = curses_resize, |
| 335 | .dpy_refresh = curses_refresh, |
| 336 | .dpy_text_cursor = curses_cursor_position, |
| 337 | }; |
| 338 | |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 339 | void curses_display_init(DisplayState *ds, int full_screen) |
| 340 | { |
| 341 | #ifndef _WIN32 |
| 342 | if (!isatty(1)) { |
| 343 | fprintf(stderr, "We need a terminal output\n"); |
| 344 | exit(1); |
| 345 | } |
| 346 | #endif |
| 347 | |
| 348 | curses_setup(); |
| 349 | curses_keyboard_setup(); |
Anthony Liguori | 2869548 | 2010-03-21 14:13:02 -0500 | [diff] [blame] | 350 | atexit(curses_atexit); |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 351 | |
| 352 | #ifndef _WIN32 |
balrog | b1314cf | 2008-02-22 18:21:28 +0000 | [diff] [blame] | 353 | #if defined(SIGWINCH) && defined(KEY_RESIZE) |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 354 | /* some curses implementations provide a handler, but we |
| 355 | * want to be sure this is handled regardless of the library */ |
| 356 | signal(SIGWINCH, curses_winch_handler); |
| 357 | #endif |
| 358 | #endif |
| 359 | |
Anthony Liguori | 7267c09 | 2011-08-20 22:09:37 -0500 | [diff] [blame] | 360 | dcl = (DisplayChangeListener *) g_malloc0(sizeof(DisplayChangeListener)); |
Gerd Hoffmann | 7c20b4a | 2012-11-13 14:51:41 +0100 | [diff] [blame] | 361 | dcl->ops = &dcl_ops; |
Gerd Hoffmann | 5209089 | 2013-04-23 15:44:31 +0200 | [diff] [blame] | 362 | register_displaychangelistener(dcl); |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 363 | |
| 364 | invalidate = 1; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 365 | } |