| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "main.h" | 6 #include "main.h" |
| 7 #include "xlib_window.h" | 7 #include "xlib_window.h" |
| 8 | 8 |
| 9 | 9 |
| 10 Display *g_xlib_display = NULL; | 10 Display *g_xlib_display = NULL; |
| 11 Window g_xlib_window = 0; | 11 Window g_xlib_window = 0; |
| 12 | 12 |
| 13 GLint g_width = 512; | 13 GLint g_width = WINDOW_WIDTH; |
| 14 GLint g_height = 512; | 14 GLint g_height = WINDOW_HEIGHT; |
| 15 bool g_override_redirect = true; | 15 bool g_override_redirect = true; |
| 16 | 16 |
| 17 | 17 |
| 18 bool XlibInit() { | 18 bool XlibInit() { |
| 19 g_xlib_display = XOpenDisplay(0); | 19 g_xlib_display = XOpenDisplay(0); |
| 20 if (!g_xlib_display) | 20 if (!g_xlib_display) |
| 21 return false; | 21 return false; |
| 22 | 22 |
| 23 int screen = DefaultScreen(g_xlib_display); | 23 int screen = DefaultScreen(g_xlib_display); |
| 24 Window root_window = RootWindow(g_xlib_display, screen); | 24 Window root_window = RootWindow(g_xlib_display, screen); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 48 XSync(g_xlib_display, True); | 48 XSync(g_xlib_display, True); |
| 49 | 49 |
| 50 XGetWindowAttributes(g_xlib_display, g_xlib_window, &attributes); | 50 XGetWindowAttributes(g_xlib_display, g_xlib_window, &attributes); |
| 51 g_width = attributes.width; | 51 g_width = attributes.width; |
| 52 g_height = attributes.height; | 52 g_height = attributes.height; |
| 53 | 53 |
| 54 XFree(xlib_visinfo); | 54 XFree(xlib_visinfo); |
| 55 | 55 |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| OLD | NEW |