Changeset 87764 in webkit
- Timestamp:
- May 31, 2011 5:43:32 PM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r87728 r87764 1 2011-05-31 Daniel Erat <derat@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 Make WebScreenInfoFactory return fresh screen dimensions. 6 https://bugs.webkit.org/show_bug.cgi?id=61679 7 8 * public/x11/WebScreenInfoFactory.h: 9 * src/x11/WebScreenInfoFactory.cpp: 10 (WebKit::WebScreenInfoFactory::screenInfo): 11 1 12 2011-05-31 Cary Clark <caryclark@google.com> 2 13 -
trunk/Source/WebKit/chromium/public/x11/WebScreenInfoFactory.h
r50712 r87764 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without -
trunk/Source/WebKit/chromium/src/x11/WebScreenInfoFactory.cpp
r50750 r87764 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 38 38 namespace WebKit { 39 39 40 // FIXME: Take an X window and use XRandR to find the dimensions of the monitor 41 // that it's on (probably using XRRGetScreenInfo() and XRRConfigSizes() from 42 // X11/extensions/Xrandr.h). GDK provides a gdk_screen_get_monitor_geometry() 43 // function, but it appears to return stale data after the screen is resized. 40 44 WebScreenInfo WebScreenInfoFactory::screenInfo(Display* display, int screenNumber) 41 45 { 46 // XDisplayWidth() and XDisplayHeight() return cached values. To ensure that 47 // we return the correct dimensions after the screen is resized, query the 48 // root window's geometry each time. 49 Window root = RootWindow(display, screenNumber); 50 Window rootRet; 51 int x, y; 52 unsigned int width, height, border, depth; 53 XGetGeometry( 54 display, root, &rootRet, &x, &y, &width, &height, &border, &depth); 55 42 56 WebScreenInfo results; 43 // FIXME: not all screens withuse 8bpp.57 // FIXME: Not all screens use 8bpp. 44 58 results.depthPerComponent = 8; 45 46 int displayWidth = XDisplayWidth(display, screenNumber); 47 int displayHeight = XDisplayHeight(display, screenNumber); 48 results.depth = XDisplayPlanes(display, screenNumber); 49 results.isMonochrome = results.depth == 1; 50 51 results.rect = WebRect(0, 0, displayWidth, displayHeight); 52 53 // I don't know of a way to query the "maximize" size of the window (e.g. 54 // screen size less sidebars etc) since this is something which only the 55 // window manager knows. 59 results.depth = depth; 60 results.isMonochrome = depth == 1; 61 results.rect = WebRect(x, y, width, height); 62 // FIXME: Query the _NET_WORKAREA property from EWMH. 56 63 results.availableRect = results.rect; 57 64
Note: See TracChangeset
for help on using the changeset viewer.