chromiumos/platform/window_manager.git
2 years agowm: Avoid log spew in window manager logs. factory-1412.B factory-1987.B master release-R17-1412.B release-R18-1660.B stabilize stabilize2
Doug Anderson [Tue, 22 Nov 2011 00:23:48 +0000 (16:23 -0800)]
wm: Avoid log spew in window manager logs.

On developer builds (where NDEBUG is not defined), the window
manager logs are growing uncontrollably.  After a few days (Nov 17
though Nov 21), I've got almost a gigabyte of logs:

  # du -sh /var/log/window_manager/
  923M /var/log/window_manager/

This machine has really just been sitting at the login prompt.
After the initial bit of debug info, logs are filled with:

  [1121/131449:21180773:INFO:opengles_visitor.cc(227)] Performing partial screen update: 405, 570, 23, 22.
  [1121/131449:21181179:INFO:opengles_visitor.cc(267)] Visit container: stage
  [1121/131449:21258991:INFO:opengles_visitor.cc(227)] Performing partial screen update: 405, 570, 23, 22.
  [1121/131449:21259441:INFO:opengles_visitor.cc(267)] Visit container: stage
  [1121/131449:21336403:INFO:opengles_visitor.cc(227)] Performing partial screen update: 405, 570, 23, 22.
  [1121/131449:21336905:INFO:opengles_visitor.cc(267)] Visit container: stage

These messages aren't providing enough useful information to the
average user to justify such log spew.  Deleting them so that we can
still keep other INFO-level logs around but don't get these ones.

NOTE that filling up /var/log so badly had the effect of
making all autotests take forever, so this should really help the
average developer.

BUG=None
TEST=Emerged and saw that log spew was gone.

Change-Id: I60d727bb8f37456a232d75aed8eabc5c59fdf0e0
Reviewed-on: https://gerrit.chromium.org/gerrit/12011
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
2 years agowm: Defer GL texture refreshes when compositing. factory-1235.B factory-1284.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B release-R16-1193.B
Daniel Erat [Thu, 6 Oct 2011 19:11:51 +0000 (12:11 -0700)]
wm: Defer GL texture refreshes when compositing.

Wait to update textures from GLX pixmaps until we're drawing
the frame.  This avoids the case where a backlog of damage
events builds up when texture updating is slow (e.g.
software rendering).

BUG=chromium-os:20971
TEST=added one; also manually tested that update latency still seems okay when compositing on alex

Change-Id: I502fbd639788d4d076a7f09d608625e67ac4ad6b
Reviewed-on: http://gerrit.chromium.org/gerrit/8872
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2 years agowm: Increase duration of screen locker fade-in to 450 ms.
Daniel Erat [Thu, 29 Sep 2011 16:25:15 +0000 (09:25 -0700)]
wm: Increase duration of screen locker fade-in to 450 ms.

The 50-millisecond fade that was there looked overly abrupt
now that the screen locker window is white instead of dark
blue.

BUG=chromium-os:20948
TEST=manual

Change-Id: I4b5d7ac25b99e1a80e13b2d45255ad8539c1ed4e
Reviewed-on: http://gerrit.chromium.org/gerrit/8580
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
2 years agowm: Draw shadows under 24-bit transient windows.
Daniel Erat [Fri, 30 Sep 2011 01:02:01 +0000 (18:02 -0700)]
wm: Draw shadows under 24-bit transient windows.

Now that Chrome is using rectangular windows for its
dialogs, the window manager should draw shadows under them
again.

BUG=chromium-os:20997
TEST=added; also manually tested that the task manager and file browser windows get shadows after updating chrome to use 24-bit windows instead of 32-bit ones for them

Change-Id: Iaf14f9795e29d9fd623c3ea1dadde522ce4b7197
Reviewed-on: http://gerrit.chromium.org/gerrit/8538
Commit-Ready: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agoFocus is returned from modal dialogs to parent window in WebUI after user is logged in.
Ivan Korotkov [Mon, 12 Sep 2011 14:03:37 +0000 (18:03 +0400)]
Focus is returned from modal dialogs to parent window in WebUI after user is logged in.

BUG=None
TEST=LoginControllerTest.FocusTransientParentWebUILoggedIn

Change-Id: I6bf1a6ab999a1a174b5a8f33e860cc548f747de0
Reviewed-on: http://gerrit.chromium.org/gerrit/7537
Reviewed-by: Ivan Korotkov <ivankr@chromium.org>
Tested-by: Ivan Korotkov <ivankr@chromium.org>
3 years agowm: Fix compilation on gcc-4.6.0. factory-1020.B
Daniel Erat [Tue, 6 Sep 2011 22:25:48 +0000 (15:25 -0700)]
wm: Fix compilation on gcc-4.6.0.

BUG=chromium-os:20071
TEST=built it

Change-Id: Idcadb48c1ebe55073cddcde78d710591f1123709
Reviewed-on: http://gerrit.chromium.org/gerrit/7296
Reviewed-by: asharif <asharif@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Avoid focusing windows in response to scrolling. factory-980.B test-982.B
Daniel Erat [Wed, 31 Aug 2011 23:12:45 +0000 (16:12 -0700)]
wm: Avoid focusing windows in response to scrolling.

This makes us only install grabs for buttons 1-3 (instead of
for all buttons) on unfocused windows, and also makes the
layout manager ignore scrollwheel events on the windows at
the edges of the screen in overlapping-windows mode.

BUG=chromium-os:19770
TEST=added tests; also manually tested by checking that a focused panel keeps the focus when i scroll in browser window and vice versa

Change-Id: I2ea7b844d6e9c458ec8d5ab28e6eae69410d865c
Reviewed-on: http://gerrit.chromium.org/gerrit/7045
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Stop linking libchromeos.
Satoru Takabayashi [Wed, 17 Aug 2011 20:34:20 +0000 (13:34 -0700)]
wm: Stop linking libchromeos.

We no longer need to link libchromeos to use D-Bus service constants.
Including dbus/service_constants.h, provided by system_api, just suffices.

BUG=chromium-os:19054
TEST=emerge-x86-alex chromeos-wm

Change-Id: I7799e0381a0bebd0e27c4834b8ba4c2f48b5f299
Reviewed-on: http://gerrit.chromium.org/gerrit/6177
Tested-by: Satoru Takabayashi <satorux@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Display a message onscreen at startup for debug builds.
Daniel Erat [Mon, 15 Aug 2011 15:47:35 +0000 (08:47 -0700)]
wm: Display a message onscreen at startup for debug builds.

BUG=chromium-os:19060
TEST=manual

Change-Id: Ie85c6ca4864e1ba0b1a7eb39ee93ca25fb0b37d8
Reviewed-on: http://gerrit.chromium.org/gerrit/5995
Reviewed-by: Dave Moore <davemoore@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Avoid leak if a duplicate login window is mapped. 0.15.877.B firmware-881-u-boot-v1 firmware-u-boot-v1
Daniel Erat [Mon, 8 Aug 2011 16:15:09 +0000 (09:15 -0700)]
wm: Avoid leak if a duplicate login window is mapped.

This is just a guess at a possible cause for a failed assert
that I've noticed on the crash server.  If a second WebUI,
background, or wizard/guest window gets mapped,
LoginController should unregister its interest in the
earlier window.

BUG=chromium-os:18809
TEST=added a test for the duplicate-wizard-window case

Change-Id: I46ec5b1c3277dcc2f87e6a3b0a4e30d1bc448335
Reviewed-on: http://gerrit.chromium.org/gerrit/5495
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Add squish animation on no-op F5 with a single window.
Daniel Erat [Fri, 5 Aug 2011 01:32:49 +0000 (18:32 -0700)]
wm: Add squish animation on no-op F5 with a single window.

This adds visual feedback when the F5 ("[  ]]]") key is
pressed when there's only a single browser window open (so
we can't perform the usual action of switching to
overlapping-windows mode).

BUG=chromium-os:18700
TEST=manual; also added a test for a compositor change

Change-Id: I009c2c529822a4a700edf2504582917af6fd9ba3
Reviewed-on: http://gerrit.chromium.org/gerrit/5486
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Don't automatically overlap browser windows.
Daniel Erat [Thu, 4 Aug 2011 23:39:45 +0000 (16:39 -0700)]
wm: Don't automatically overlap browser windows.

This makes us stay in maximized-window mode when a second
browser window is mapped.  Overlapping mode can still be
toggled when multiple windows are open by hitting the F5
("[  ]]]") key or by clicking the maximize/restore icon in
the upper-right corner.

BUG=chromium-os:18699
TEST=manual, also added a test for the flag

Change-Id: Id79be66dd5ba650b5bc032cc93136a1e943d2aa0
Reviewed-on: http://gerrit.chromium.org/gerrit/5355
Reviewed-by: Dave Moore <davemoore@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Display borders when hovering over resize handles.
Daniel Erat [Thu, 28 Jul 2011 00:28:13 +0000 (17:28 -0700)]
wm: Display borders when hovering over resize handles.

This makes us display a translucent black box when the
pointer is over a border that can dragged to resize a
browser window.

Ideally, we'd do something similar for panels as well, and
we'd fade to a nicer-looking, heavier shadow instead of just
drawing a translucent box.  This doesn't look too terrible
to me, though, and gives us a way to see how this feels.

BUG=chromium-os:18092
TEST=manual; also added tests

Change-Id: I3b10a2c849aa741a2f5db2b8c67cc7dac6039169
Reviewed-on: http://gerrit.chromium.org/gerrit/5236
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Fix some timerfd leaks.
Daniel Erat [Wed, 3 Aug 2011 17:49:13 +0000 (10:49 -0700)]
wm: Fix some timerfd leaks.

There were a few places where I wasn't removing one-shot
timeouts after they fired.  This corrects that, adds a
DCHECK() to EventLoop's d'tor to make these easier to catch,
and makes mostly-cosmetic cleanups to some other
timeout-related code.

BUG=chromium-os:18556
TEST=verified that updated tests pass; also ran this code, locked and unlocked the screen several times, and checked that what I think is the expected number of timer FDs are open (two: one for the compositor and one for the watchdog) -- with the old code, there are more open and the number grows whenever I lock and unlock the screen

Change-Id: I307921bdf35a5c787881fb27911f1989427bbb65
Reviewed-on: http://gerrit.chromium.org/gerrit/5222
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Snap to maximized when interactively resizing browser.
Daniel Erat [Thu, 28 Jul 2011 16:37:06 +0000 (09:37 -0700)]
wm: Snap to maximized when interactively resizing browser.

This makes the interactive resize triggered by dragging a
browser window's border snap to maximized mode if the user
drags 50 pixels or more beyond the maximum width permitted
for unmaximized windows.

BUG=chromium-os:17160
TEST=manual; also added a simple test

Change-Id: I0514bfecfc6ec913f00fe56111e14c6d1ea826bb
Reviewed-on: http://gerrit.chromium.org/gerrit/4965
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Switch to last window on Alt-9.
Daniel Erat [Mon, 25 Jul 2011 17:52:51 +0000 (10:52 -0700)]
wm: Switch to last window on Alt-9.

Alt-1 through Alt-8 were implemented, but Alt-9 wasn't doing
anything.

BUG=chromium-os:18129
TEST=manual; also wrote a test for these hotkeys

Change-Id: I5ac31147e26213fdd83696156a7a862c13b5097b
Reviewed-on: http://gerrit.chromium.org/gerrit/4679
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Focus newest-mapped modal window.
Daniel Erat [Fri, 22 Jul 2011 02:38:16 +0000 (19:38 -0700)]
wm: Focus newest-mapped modal window.

Update the window manager so that when a browser has
multiple modal transient windows, the most-recently-mapped
one gets the focus and is raised above its siblings.

BUG=chromium-os:17642
TEST=added; manual testing suggests that there may be another issue in chrome

Change-Id: I1cbe1dff6c590a25aa0c134be5748e44ff7d98dd
Reviewed-on: http://gerrit.chromium.org/gerrit/4551
Reviewed-by: James Cook <jamescook@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Screenshot user-selectable region on Ctrl-Shift-F5. 780.B
Daniel Erat [Wed, 13 Jul 2011 17:18:19 +0000 (10:18 -0700)]
wm: Screenshot user-selectable region on Ctrl-Shift-F5.

I am tired of scp-ing screenshots and running Gimp to crop
them whenever I'm filing a bug.  This adds a --region flag
to the screenshot program, triggering an interactive mode
where a box can be dragged to take a screenshot.  Escape
aborts.

I think that the usual way to do rubber-banding is by
grabbing the server and painting on the root window with an
inverting GC, but I don't think that that'll work with a
compositing window manager.  This code just uses four
windows to draw black and white borders around the region
instead.

BUG=none
TEST=manual

Change-Id: If6ebc4efe09413542a8d8f7b131dae8111c5c814
Reviewed-on: http://gerrit.chromium.org/gerrit/4198
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Make layout code take panel dock size into account.
Daniel Erat [Tue, 12 Jul 2011 00:26:04 +0000 (17:26 -0700)]
wm: Make layout code take panel dock size into account.

The (unfinished) panel docking code is still disabled by
default (see --allow_panels_to_be_detached), but this
updates the new layout code to take the dock sizes into
account.  (The old layout code already supported this; I
just didn't bother porting it).

BUG=chromium-os:16616
TEST=added; also did manual testing

Change-Id: Icc0d27576e57ada12186352b399eabdf65c58de0
Reviewed-on: http://gerrit.chromium.org/gerrit/4069
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Avoid animating Views login after WebUI is ready.
Daniel Erat [Thu, 14 Jul 2011 18:50:15 +0000 (11:50 -0700)]
wm: Avoid animating Views login after WebUI is ready.

I don't think that the original intent was to mix WebUI and
Views login windows, but that seems to be what we're doing
now.  This change tracks the "WebUI is ready" state so we
don't do initialization for both WebUI and Views if a Views
window gets mapped later.

BUG=chromium-os:1706
TEST=xiyuan says it works

Change-Id: Ibe9824a83f1fcf3471310ce91a03d58ab0ea4ad2
Reviewed-on: http://gerrit.chromium.org/gerrit/4103
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Avoid crash when recycled windows are configured.
Daniel Erat [Mon, 11 Jul 2011 23:16:37 +0000 (16:16 -0700)]
wm: Avoid crash when recycled windows are configured.

This avoids an infrequent failed assert that I believe is
happening when a window is mapped and has its visibility set
before getting unmapped and configured.

BUG=chromium-os:17376
TEST=added

Change-Id: I0b2144a0f0ffe7bc49cf0bea9e7b8c75acf2cac3
Reviewed-on: http://gerrit.chromium.org/gerrit/3902
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Avoid crash when browser is unmapped before transients.
Daniel Erat [Fri, 8 Jul 2011 01:15:35 +0000 (18:15 -0700)]
wm: Avoid crash when browser is unmapped before transients.

This avoids a crash when a browser gets unmapped before its
transient windows.

BUG=chromium-os:17377
TEST=added

Change-Id: Id9fb78e952848cc63d7df4e3c7359d480ad453a0
Reviewed-on: http://gerrit.chromium.org/gerrit/3771
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Refocus window after screen unlock.
Daniel Erat [Thu, 7 Jul 2011 21:25:00 +0000 (14:25 -0700)]
wm: Refocus window after screen unlock.

We weren't doing anything with the input focus after the
screen locker window got unmapped.  This wasn't super
obvious since the focus would just follow the pointer until
the next time we explicitly assigned it.

BUG=none
TEST=manual; also added a test

Change-Id: I0ee92b85dd0608f2401b5a45314e09bf22a99295
Reviewed-on: http://gerrit.chromium.org/gerrit/3754
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Improve handling of non-Chrome windows.
Daniel Erat [Thu, 7 Jul 2011 00:10:15 +0000 (17:10 -0700)]
wm: Improve handling of non-Chrome windows.

When there's a Chrome window on the left side of the screen
and a terminal window on the right, refrain from hiding the
Chrome window's status area.

Also send a delete request to the focused window on
Ctrl-Shift-W if it isn't a Chrome window.  This provides a
way to close e.g. terminals containing hanging SSH sessions.
I'm still a bit concerned that Ctrl-Shift-W will be easy to
accidentally type when holding Shift to type a capitalized
word and then hitting Ctrl-W to delete it, but Ctrl-Shift-W
matches CHrome's "close window" binding, and I can't think
of anything better.  We'll see...

BUG=chromium-os:17236,chromium-os:10023
TEST=added tests

Change-Id: If0aa1cb959f38df1f0eaa23c39cac8625aab5777
Reviewed-on: http://gerrit.chromium.org/gerrit/3697
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Save screenshots directly to file shelf.
Daniel Erat [Fri, 1 Jul 2011 00:48:22 +0000 (17:48 -0700)]
wm: Save screenshots directly to file shelf.

Write Ctrl-F5 screenshots to /home/chronos/user/Downloads
instead of to /home/chronos/user/Downloads/Screenshots.

BUG=chromium-os:16883
TEST=manual: hit Ctrl-F5, then Ctrl-O

Change-Id: I11bd524c36ffccb8ff5082a0a8a779976432161d
Reviewed-on: http://gerrit.chromium.org/gerrit/3528
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Replace system() calls with fork-exec.
Daniel Erat [Mon, 6 Jun 2011 15:47:47 +0000 (08:47 -0700)]
wm: Replace system() calls with fork-exec.

This replaces the previous system() calls with a manual
fork() and exec().

BUG=chromium-os:16153
TEST=manual: launched a terminal and checked that /proc listed the expected FDs and that there wasn't a zombie hanging around after the terminal exited

Change-Id: Ib70ea1dc6f687bb32eaf6da69a2f7527290c03b8
Reviewed-on: http://gerrit.chromium.org/gerrit/2766
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agoStack WebUI window to LAYER_LOGIN_WINDOW.
Nikita Kostylev [Fri, 1 Jul 2011 21:56:53 +0000 (14:56 -0700)]
Stack WebUI window to LAYER_LOGIN_WINDOW.
LAYER_LOGIN_OTHER_WINDOW is used for info bubbles and dialogs.

Tested with http://codereview.chromium.org/7285029/

BUG=chromium-os:16177
TEST=Manual. Network control window is positioned correctly.

Change-Id: I0177dde54947a4032fe5f578c437e902003db248
Reviewed-on: http://gerrit.chromium.org/gerrit/3586
Tested-by: Nikita Kostylev <nkostylev@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Fix float comparisons in compositor culling code.
Daniel Erat [Thu, 30 Jun 2011 18:27:48 +0000 (11:27 -0700)]
wm: Fix float comparisons in compositor culling code.

The culling code does floating-point arithmetic and compares
the results directly against literals.  Tests exercising
this code fail on some CPU architectures.  This change
fudges the literals enough to compensate for the
differences.

BUG=none
TEST=tests pass now; also ran the code and checked that it still appears to function properly

Change-Id: Ic14d4d3df6595d7c84c02e7ba5df055b0ecc1728
Reviewed-on: http://gerrit.chromium.org/gerrit/3478
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Round animation_test values to ints.
Daniel Erat [Thu, 30 Jun 2011 01:18:26 +0000 (18:18 -0700)]
wm: Round animation_test values to ints.

Despite using EXPECT_FLOAT_EQ(), we're seeing failures on
other CPU architectures.  The compositor rounds animation
values to int as well, so having the test do this seems
legit.

BUG=none
TEST=it passes now (other tests still fail)

Change-Id: I3feb653b8467c0ad1d5f94649a48b108b3b55e83
Reviewed-on: http://gerrit.chromium.org/gerrit/3428
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Don't focus browsers in response to status area clicks.
Daniel Erat [Wed, 29 Jun 2011 15:22:49 +0000 (08:22 -0700)]
wm: Don't focus browsers in response to status area clicks.

This makes us fetch the _CHROME_STATUS_BOUNDS property to
learn about the bounds of a window's status area.  We use
this to let the user click in an inactive browser's status
area without focusing it.

BUG=chromium-os:17083
TEST=added

Change-Id: I6560c0495b94a2d421429652833300e39c390bde
Reviewed-on: http://gerrit.chromium.org/gerrit/3385
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
3 years agowm: Fix actor clip rect accuracy.
David Reveman [Wed, 29 Jun 2011 05:11:04 +0000 (01:11 -0400)]
wm: Fix actor clip rect accuracy.

Clip rects and bounds need to be rounded differently. Clip rects need to
be mapped to stage coordinates accurately while we need to be properly
conservative when mapping actor bounds.

BUG=chromium-os:17043
TEST=New unit test

Change-Id: Ifc89862b9e52f2e1f364fcc0d562ae3ff1a0120a
Reviewed-on: http://gerrit.chromium.org/gerrit/3366
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Enable overlapping-windows mode.
Daniel Erat [Tue, 28 Jun 2011 17:35:48 +0000 (10:35 -0700)]
wm: Enable overlapping-windows mode.

This removes --multiple_windows=false from
/sbin/window-manager-session.sh.

BUG=chromium-os:13963
TEST=manual: built and ran it

Change-Id: I6b7899448bf5c9aceb60d773345cc6298a09bfc3
Reviewed-on: http://gerrit.chromium.org/gerrit/3311
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Shrink the status area to 180 pixels.
Daniel Erat [Tue, 28 Jun 2011 01:29:30 +0000 (18:29 -0700)]
wm: Shrink the status area to 180 pixels.

This reduces the amount of space that we reserve onscreen
for Chrome's status area from 200 pixels to 180, which seems
to still be enough when multiple input methods are enabled
and leaves a bit more room for the active browser (the
maximum browser width was less than 1024 pixels on Alex and
Mario, otherwise).

Unrelated, but also set names for a few compositing actors
that I missed before.

BUG=chromium-os:13963
TEST=manual: checked that unmaximized windows start out at 1024 pixels now

Change-Id: I51c4136e628fe467f99efd63464d57eae00c0db8
Reviewed-on: http://gerrit.chromium.org/gerrit/3289
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Support client requests to change layout modes.
Daniel Erat [Thu, 23 Jun 2011 22:51:58 +0000 (15:51 -0700)]
wm: Support client requests to change layout modes.

This makes the window manager honor
WM_IPC_MESSAGE_WM_SET_LAYOUT_MODE messages from Chrome
asking it to switch layout modes (e.g. with maximized or
overlapping windows).  It also now sets a
_CHROME_LAYOUT_MODE property on the root window that Chrome
can watch to track the current mode.

I'm also removing the Alt-Enter shortcut to toggle maximized
mode, since it conflicts with Chrome's open-URL-in-new-tab
omnibox shortcut.  F5 still works for toggling modes.

BUG=chromium-os:13963,chromium-os:16818
TEST=manual; also added tests

Change-Id: Ic97808650aa84aa6472426a317e15bd0003328b0
Reviewed-on: http://gerrit.chromium.org/gerrit/3145
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Minor improvement to dimming of secondary browser.
Daniel Erat [Fri, 24 Jun 2011 20:31:53 +0000 (13:31 -0700)]
wm: Minor improvement to dimming of secondary browser.

This is small change to correct part of b604c918's behavior
that I found disorienting:

  1. Open three browsers.
  2. Activate second browser.
  3. Hit Alt-Tab to switch to third browser.
     Second browser begins gradually dimming.
  4. Hit Alt-Tab again to cycle to first browser.
     Second browser jumps to 90% brightness immediately.

With this change, the second browser instead continues
gradually dimming in step 4.

BUG=chromium-os:13963
TEST=manual

Change-Id: I90ebac2a11b3cc0326fddb7ba1e83f9c15755dd3
Reviewed-on: http://gerrit.chromium.org/gerrit/3187
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Avoid jank when switching layout modes.
Daniel Erat [Fri, 24 Jun 2011 16:36:30 +0000 (09:36 -0700)]
wm: Avoid jank when switching layout modes.

This makes the window manager smarter about the order in
which it resizes browser windows when switching from
overlapping mode to maximized mode or vice versa.  When
switching to maximized mode, we wait for the active browser
to be fully covering the screen before configuring other
browsers; when switching to overlapping, we wait for all of
the other browsers to be in place before resizing the active
browser.

BUG=chromium-os:13963
TEST=manual; also added a test

Change-Id: I4f107ddeddf6618e8ffbcd8d8f0c49f36c978046
Reviewed-on: http://gerrit.chromium.org/gerrit/3175
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Gradually dim secondary browser window.
Daniel Erat [Thu, 16 Jun 2011 23:39:42 +0000 (16:39 -0700)]
wm: Gradually dim secondary browser window.

We dim the secondary (onscreen but unfocused) browser window
to 90% brightness over ten seconds when it loses the focus.
This makes it easier to tell at a glance where the focus is.

BUG=chromium-os:13963
TEST=manual; also added expectations to existing layout tests

Change-Id: Ida15b84a37a27db2b1c4b0753e5e7619b3e3da07
Reviewed-on: http://gerrit.chromium.org/gerrit/3132
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Fix debug needle drawing.
David Reveman [Thu, 23 Jun 2011 19:53:38 +0000 (15:53 -0400)]
wm: Fix debug needle drawing.

Disable partial updates in GL compositor when debug needle is enabled.

BUG=chromium-os:16908
TEST=manual

Change-Id: Iec71514fb8efe0fff59a28a07bdc43d9cd0a1d27
Reviewed-on: http://gerrit.chromium.org/gerrit/3120
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Add tests for multiple-window layout code.
Daniel Erat [Wed, 22 Jun 2011 23:28:58 +0000 (16:28 -0700)]
wm: Add tests for multiple-window layout code.

This also fixes a small bug in the code that computes
positions for offscreen windows, and removes the
--show_window_edges flag (it's always on, now).

BUG=chromium-os:13963
TEST=added

Change-Id: Ib48bd88845a4f08402de2db41535f0f84f95b699
Reviewed-on: http://gerrit.chromium.org/gerrit/3103
Tested-by: Daniel Erat <derat@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
3 years agowm: Make SetBounds() send a single ConfigureWindow request.
Daniel Erat [Fri, 17 Jun 2011 04:13:04 +0000 (21:13 -0700)]
wm: Make SetBounds() send a single ConfigureWindow request.

This avoids tickling a GTK+ bug that results in a window's
_NET_WM_SYNC_REQUEST counter being updated before the window
has been repainted when a resize and move are done in quick
succession.

BUG=chromium-os:13963,chromium-os:16716
TEST=manual; also added a test

Change-Id: Ie27ab75239799e0646eac49d77ce9e5f0f0a514d
Reviewed-on: http://gerrit.chromium.org/gerrit/2877
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Make F5 toggle maximized instead of cycling windows.
Daniel Erat [Mon, 20 Jun 2011 19:39:20 +0000 (12:39 -0700)]
wm: Make F5 toggle maximized instead of cycling windows.

This makes the "window switcher" key toggle in and out of
maximized mode (at least when --multiple_windows is enabled;
when it's disabled, the key still cycles through windows).

BUG=chromium-os:13963
TEST=manual

Change-Id: Iba7f52a4ef20a095e0a11981ae3ea413a7e3e5e9
Reviewed-on: http://gerrit.chromium.org/gerrit/2890
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Improve stacking of browser shadows while maximized.
Daniel Erat [Wed, 15 Jun 2011 16:42:55 +0000 (09:42 -0700)]
wm: Improve stacking of browser shadows while maximized.

Each browser window's shadow was previously always stacked
directly beneath the browser window (and often above other
browser windows).  This was barely visible when cycling
through windows and looked strange.

When maximized, this change makes us instead stack each
browser window's shadow at the bottom of the inactive
browser layer, beneath all of the other browser windows.

Note that there's an existing issue (rounding problem in the
compositor's animation code?) that sometimes results in a
flickery black column of pixels between the two windows when
cycling.

BUG=chromium-os:13963
TEST=manual: increased window-cycling animation duration to 2.5 seconds.  also wrote a test.

Change-Id: I2b66577afcad37d1033b5ce9e65b36f871d96d6a
Reviewed-on: http://gerrit.chromium.org/gerrit/2713
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Use Region for more precise partial screen updates.
David Reveman [Mon, 13 Jun 2011 14:27:27 +0000 (10:27 -0400)]
wm: Use Region for more precise partial screen updates.

This makes the partial update code in LayerVisitor use the Region data
type instead of a simple rectangle. The GL compositor takes advantage of
this and minimizes the redraw area.

BUG=chromium-os:16418
TEST=RealCompositorTest.PartialUpdates

Change-Id: I5e31ceb0f63ffc0e8342317e7908d15e8106cb5e
Reviewed-on: http://gerrit.chromium.org/gerrit/2544
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
3 years agowm: Add _NET_WM_PING response time histogram.
Daniel Erat [Tue, 14 Jun 2011 20:45:47 +0000 (13:45 -0700)]
wm: Add _NET_WM_PING response time histogram.

This creates an UMA histogram named
WindowManager.ChromePingResponseTime containing response
times from _NET_WM_PING requests sent to Chrome.

BUG=chromium-os:16003
TEST=manual: logged reports and checked that the values were reasonable

Change-Id: I22190cff18651eb94c4f3a08de6fc654ce45f1eb
Reviewed-on: http://gerrit.chromium.org/gerrit/2628
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Re-add window-switching user action metrics.
Daniel Erat [Tue, 14 Jun 2011 19:59:14 +0000 (12:59 -0700)]
wm: Re-add window-switching user action metrics.

I dropped these calls in the rewrite of the layout code.
I don't know that anyone is still looking at them, but I
think that it makes sense to hang on to them for now.

BUG=none
TEST=none (other than testing that it compiles; this is just a copy-and-paste of the previously-working code)

Change-Id: I2038d72aaf4a199fe8315030a270db61194bf91e
Reviewed-on: http://gerrit.chromium.org/gerrit/2624
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Rewrite layout code to support multiple windows.
Daniel Erat [Fri, 8 Apr 2011 22:35:30 +0000 (15:35 -0700)]
wm: Rewrite layout code to support multiple windows.

This is a shorter (and hopefully much simpler) rewrite of
the existing LayoutManager class, creatively named
LayoutManager2.  I've removed the overview mode code and
added support for displaying multiple browser windows
onscreen at once (currently disabled, as it needs more
polish before seeing the light of day).

The philosophy for laying out individual windows has
changed.  The old code contained a ToplevelWindow class that
held information about a Window's current state (e.g.
active, offscreen-to-left, etc.) and logic for transitioning
between different states.  Now, there's BrowserWindow, a
dumb wrapper around a Window that just knows how to do
simple operations like changing the window's bounds or
restacking it as well as tracking fairly low-level state
(e.g. what should the window's width be when it's not
maximized?).  All of the smarts stay in LayoutManager2,
which I think makes the code easier to follow and also makes
it easier to coordinate animations of multiple windows at
once (resulting in e.g. less jank when Alt-Tab-ing).

BUG=chromium-os:13963,chromium-os:9054,chromium-os:4340
TEST=lots of manual testing; also tried to get LayoutManager2 test coverage roughly similar to what LayoutManager had; also ran smoke suite on a VM

Change-Id: I58153c0ae5a650630fab34b23060740014e29d74
Reviewed-on: http://gerrit.chromium.org/gerrit/2259
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Add occlusion culling to GL compositor.
David Reveman [Wed, 8 Jun 2011 21:17:50 +0000 (17:17 -0400)]
wm: Add occlusion culling to GL compositor.

This adds basic occlusion culling to the GL compositor. Each actor clip
rect is rendered separately by setting the scissor box.

BUG=chromium-os:15942
TEST=Manual

Change-Id: I4ef18fdbeaa79a531fdf94f59bf8096e7d3a96d0
Reviewed-on: http://gerrit.chromium.org/gerrit/2353
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
3 years agowm: Add occlusion culling support.
David Reveman [Thu, 9 Jun 2011 21:41:44 +0000 (17:41 -0400)]
wm: Add occlusion culling support.

Makes LayerVisitor compute the visible region of each actor when
traversing the tree. This visible region can optionally be used by
drawing backends to avoid unnecessary drawing of occluded actor regions.

BUG=chromium-os:15942
TEST=New Clipping unit tests

Change-Id: If4e01f67eee813b1a395ed34f4be3974a6096aef
Reviewed-on: http://gerrit.chromium.org/gerrit/2403
Tested-by: David Reveman <reveman@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Add Region class.
David Reveman [Wed, 8 Jun 2011 06:00:45 +0000 (02:00 -0400)]
wm: Add Region class.

This adds a thin C++ wrapper around the Xlib region code and relevant
unit tests.

BUG=chromium-os:15942
TEST=New region unit tests

Change-Id: Ic1ec544b4d1beb4a2b5a8e743e6611aa60daa75f
Reviewed-on: http://gerrit.chromium.org/gerrit/2303
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: David Reveman <reveman@chromium.org>
3 years agowm: Stack an input window under focused modal dialogs.
Daniel Erat [Mon, 6 Jun 2011 17:20:34 +0000 (10:20 -0700)]
wm: Stack an input window under focused modal dialogs.

This prevents windows in the background from receiving
events from the pointer and prevents the cursor from
changing if the user e.g. moves the pointer over a panel's
resize handle.

BUG=chromium-os:9054
TEST=manual (opened a modal dialog and checked that i couldn't interact with other windows); also wrote a new test and removed an obsolete existing test

Change-Id: I234f6f4c33a465fa40395723bfe102f28d0e90f9
Reviewed-on: http://gerrit.chromium.org/gerrit/2189
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Fix compilation errors in gcc-4.6.
Daniel Erat [Mon, 6 Jun 2011 16:04:49 +0000 (09:04 -0700)]
wm: Fix compilation errors in gcc-4.6.

This moves RealCompositor::QuadActor's destructor and
another method into real_compositor.cc and adds a missing
include.  This ought to fix an "invalid application of
'sizeof' to incomplete type 'window_manager::TextureData'"
error.

I'm also removing some unused variables from LayoutManager.

BUG=chromium-os:16054
TEST=builds under gcc-4.6.0

Change-Id: Iac10e2c893db7516770818ed4fadcd2bb9cb0525
Reviewed-on: http://gerrit.chromium.org/gerrit/2163
Reviewed-by: asharif <asharif@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Add flaky TexturePixmapActor::Clone().
Daniel Erat [Fri, 15 Apr 2011 01:14:09 +0000 (18:14 -0700)]
wm: Add flaky TexturePixmapActor::Clone().

This adds a simple implementation to clone an actor that's
tracking a pixmap.  The cloned actor won't get updates; I'm
just using this in some experimental, off-by-default code.

BUG=chromium-os:13963
TEST=manual testing in conjunction with another change

Change-Id: Ia85ae0a044350693ab0cce01a682b058cb7e4ca2
Reviewed-on: http://gerrit.chromium.org/gerrit/2132
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Add several testing methods.
Daniel Erat [Fri, 20 May 2011 21:10:50 +0000 (14:10 -0700)]
wm: Add several testing methods.

This adds TestWindowIsAboveOtherWindow() and
IntArrayPropertyContains() to BasicWindowManagerTest.

BUG=chromium-os:13963
TEST=using these methods in new tests

Change-Id: Iddef1d494a6e476336241b1bd0320bdb54801fc0
Reviewed-on: http://gerrit.chromium.org/gerrit/2160
Reviewed-by: David Reveman <reveman@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Handle faked screen resizes.
Daniel Erat [Fri, 3 Jun 2011 22:46:45 +0000 (15:46 -0700)]
wm: Handle faked screen resizes.

This adds support for a BOGUS_SCREEN_RESIZES macro that can
be defined on hardware where we're unable to actually resize
the screen and instead send synthetic ConfigureNotify events
about the root window.  We need to clear the stage before we
resize it in this case; otherwise, we'll end up permanently
displaying whatever what was last drawn there.

BUG=chrome-os-partner:3988
TEST=manual testing with a little X program that sends synthetic ConfigureNotify events about the root window

Change-Id: I2ea453132eadb766234574d3211f117863d97699
Reviewed-on: http://gerrit.chromium.org/gerrit/2125
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Improve TransientWindowCollection stacking.
Daniel Erat [Fri, 3 Jun 2011 19:15:23 +0000 (12:15 -0700)]
wm: Improve TransientWindowCollection stacking.

This makes TransientWindowCollection's constructor take a
variable describing whether the transient windows should be
stacked directly above their owner or in the transient
window layer (previously, this was specified whenever adding
a new window or restacking all the windows, which didn't
make much sense).

I'm also removing the concept of an alternate window to
stack the transients above -- I initially added this for
panels but it's not being used anymore.

Finally, I'm fixing a bug where we could incorrectly stack a
transient window that should be at the bottom of the
collection at the top of the transient window layer instead.

BUG=chromium-os:13963
TEST=ran existing tests and added a new test

Change-Id: I5243dcabf5e4e8bc276c6b55a718c053291fe124
Reviewed-on: http://gerrit.chromium.org/gerrit/2099
Reviewed-by: Greg Spencer <gspencer@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: More testing cleanup.
Daniel Erat [Wed, 1 Jun 2011 21:59:49 +0000 (14:59 -0700)]
wm: More testing cleanup.

This makes some testing code more debuggable: rather than
just calling EXPECT_*() inside of helper functions, we also
return bool so the caller can use its own EXPECT_TRUE() to
log the line number of the failure.

I'm also fixing the _NET_CLIENT_LIST_STACKING test.  We
update the property in response to ConfigureNotify events,
but the test wasn't sending these; it was just relying on
the fact that the initial stacking of windows matched the
desired order.

BUG=chromium-os:13963
TEST=ran them

Change-Id: I16536c4dae016c5d6689c84c4a47ea16380fec1e
Reviewed-on: http://gerrit.chromium.org/gerrit/1915
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Reland window move/resize change. 0.13.587.B
Daniel Erat [Tue, 31 May 2011 18:32:12 +0000 (11:32 -0700)]
wm: Reland window move/resize change.

This reverts commit
40fa1bdc99438cd74021841aa8c27f479afa8b94, relanding
c3d869929f26a1cd02b7a464083aeddd18b0642b.  I've fixed an
issue with the deprecated move/resize interface in the
Window class.

Original description:

I had previously written tricky code that kept track of the
gravity used during a resize and tried to use that to make
an informed decision about how to update the actor's
position.  This falls down when using SetBounds() to do more
complicated simultaneous move/resizes where none of the
window's edges remains fixed.

Much simpler is to track a window's requested composited
position but hold off entirely on updating the actor's
position until the actor's size matches that of the
underlying X window.

BUG=chromium-os:13963
TEST=added; also tried it and didn't notice anything being obviously broken

Change-Id: Ifdfe1040b3bd336c507874a7901c4b24988e8e78
Reviewed-on: http://gerrit.chromium.org/gerrit/1838
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Greg Spencer <gspencer@chromium.org>
3 years agoRevert "wm: Make window move/resize code simpler and more robust."
xiyuan [Sat, 28 May 2011 06:10:25 +0000 (23:10 -0700)]
Revert "wm: Make window move/resize code simpler and more robust."

This reverts commit c3d869929f26a1cd02b7a464083aeddd18b0642b.

BUG=none
TEST=WindowTest.SimultaneousMoveAndResize should pass.

Change-Id: I765325410cc5c6aa8ae9aebb13950741cc072e8f
Reviewed-on: http://gerrit.chromium.org/gerrit/1779
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
3 years agowm: Make window move/resize code simpler and more robust.
Daniel Erat [Tue, 24 May 2011 21:40:49 +0000 (14:40 -0700)]
wm: Make window move/resize code simpler and more robust.

I had previously written tricky code that kept track of the
gravity used during a resize and tried to use that to make
an informed decision about how to update the actor's
position.  This falls down when using SetBounds() to do more
complicated simultaneous move/resizes where none of the
window's edges remains fixed.

Much simpler is to track a window's requested composited
position but hold off entirely on updating the actor's
position until the actor's size matches that of the
underlying X window.

BUG=chromium-os:13963
TEST=added; also tried it and didn't notice anything being obviously broken

Change-Id: Ibeaba33397dcac76f8ed655506e47d781c975d6f
Reviewed-on: http://gerrit.chromium.org/gerrit/1637
Reviewed-by: Greg Spencer <gspencer@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Login-related test improvements.
Daniel Erat [Thu, 19 May 2011 20:55:02 +0000 (13:55 -0700)]
wm: Login-related test improvements.

Make BasicWindowManagerTest::GetCompositedWindowBounds()
return the actor's actual current bounds rather than the
composited bounds from the Window object.  This exposed a
bug in a login test that was testing for no-longer-current
behavior (but doing it incorrectly and hence still passing).

BUG=chromium-os:13963
TEST=ran tests

Change-Id: I74bc6ec12672a1ea2bdddd09dd7b9fef42b6badd
Reviewed-on: http://gerrit.chromium.org/gerrit/1204
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Add parameter for click-to-focus passthrough.
Daniel Erat [Thu, 5 May 2011 16:48:42 +0000 (09:48 -0700)]
wm: Add parameter for click-to-focus passthrough.

This adds a parameter to
FocusManager::UseClickToFocusForWindow() to control whether
the click that focuses a window is passed through to the
client or not.

BUG=chromium-os:13963
TEST=manual: tested in conjunction with another change

Change-Id: I3c99f3bbda6ffe145cab092be074ce59224bfbfd
Reviewed-on: http://gerrit.chromium.org/gerrit/1225
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
3 years agowm: Don't mess with override-redirect transient windows.
Daniel Erat [Wed, 25 May 2011 22:03:10 +0000 (15:03 -0700)]
wm: Don't mess with override-redirect transient windows.

PanelManager previously didn't ignore override-redirect
windows, resulting in it sending delete requests to ones
that were marked as being transient for panels (such as the
status bubble).  This causes crashes in Chrome.

I'm also fixing some other configuration requests that we
could send for override-redirect window in some cases.

BUG=chromium-os:15422
TEST=added a test; also manually tested with steps from bug

Change-Id: Idf09fd053f1f7e09bc3ac1180bc288790fc07f6b
Reviewed-on: http://gerrit.chromium.org/gerrit/1575
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Set root window's cursor at startup.
Daniel Erat [Wed, 25 May 2011 20:15:03 +0000 (13:15 -0700)]
wm: Set root window's cursor at startup.

Chrome used to do this, but it was removed by
http://codereview.chromium.org/6973029/, which unified some
login code.  Our X server is patched to clear the root
window's cursor at startup.  As a result, windows that
didn't have a cursor set were inheriting the empty cursor
from the root.  Setting the cursor in the window manager (as
we used to do a long time ago) fixes this.

BUG=chromium-os:15767
TEST=manual: did a regular build; checked that the cursor is still hidden at startup and that it appears as soon as i move it and doesn't disappear when moved over certain windows

Change-Id: I5737f34856fbfbd7ff75e7d9ddc861f2e57280b8
Reviewed-on: http://gerrit.chromium.org/gerrit/1559
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agoRespect PKG_CONFIG variable if set in the environment.
Diego Elio Pettenò [Tue, 24 May 2011 10:28:05 +0000 (12:28 +0200)]
Respect PKG_CONFIG variable if set in the environment.

This is required for the new cross-compilation support using pkg-config
wrappers instead of changing the pkg-config files themselves.

BUG=none
TEST=emerge-arm-generic with and without pkg-config wrappers

Change-Id: Ia0b12e6537dab93f445d1500b4f70d36b5ea1a47
Reviewed-on: http://gerrit.chromium.org/gerrit/1445
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Diego Elio Pettenò <flameeyes@chromium.org>
3 years agoAdd detection and handling for WebUI login.
Ryan Harrison [Thu, 12 May 2011 14:19:40 +0000 (10:19 -0400)]
Add detection and handling for WebUI login.

This adds support for WebUI based login. It detects the creation of a chromeos::WM_IPC_WINDOW_LOGIN_WEBUI type window. When this occurs an alternate handling path is used, since the standard set of login windows will not be generated.

BUG=none
TEST=Added tests to login_controller_test.cc and manually tested on device.

Change-Id: Ib1584b5191d0a8210d546a90be2d4ee9f350dd86
Reviewed-on: http://gerrit.chromium.org/gerrit/759
Reviewed-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Nikita Kostylev <nkostylev@chromium.org>
Tested-by: Ryan Harrison <rharrison@chromium.org>
3 years agowm: Fix random issues I ran into while porting tests. 0.13.558.B
Daniel Erat [Wed, 18 May 2011 01:31:54 +0000 (18:31 -0700)]
wm: Fix random issues I ran into while porting tests.

This fixes some problems that I saw while running the
existing tests against the new layout code that I'm working
on.

- LayoutManager was doing some work for PanelManager's
  transient windows that it shouldn't (mapping them and
  stacking them).
- WindowManager was destroying ModalityHandler before some
  of the EventConsumers that might depend on it.
- One of the WindowManager tests was depending on a key
  binding installed by LayoutManager, which is a bit ugly.
  I've made it use one of the WindowManager keybindings
  instead.
- Transient dialogs were getting stacked directly above the
  panels to which they belonged, making it possible for
  a second panel to be stacked above the dialog (which
  looked pretty strange).

BUG=chromium-os:13963
TEST=ran them

Change-Id: I545c8813551ae17fd502345294cd9f998348ea30
Reviewed-on: http://gerrit.chromium.org/gerrit/1137
Reviewed-by: Greg Spencer <gspencer@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Reduce jank when panels are first created.
Daniel Erat [Thu, 12 May 2011 22:01:51 +0000 (15:01 -0700)]
wm: Reduce jank when panels are first created.

This change makes us:
- avoid displaying a panel until the content window's pixmap
  has been loaded (otherwise, there's a chance that there
  will be some frames where we draw the titlebar but not the
  content)
- resize the titlebar window to match the content window's
  width as soon as the content window is mapped (otherwise,
  it usually get resized in the middle of the
  sliding-onscreen animation, which makes us skip the
  animation)

BUG=chromium-os:14717
TEST=added a test; also opened panels and checked that the titlebar and content now slide up together instead of the titlebar appearing first

Change-Id: I8dde497a6098fc837fc1b93b833726dccf3118ca
Reviewed-on: http://gerrit.chromium.org/gerrit/805
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years ago[window_manager] Roll forward to new libchrome
Chris Masone [Thu, 12 May 2011 20:04:53 +0000 (13:04 -0700)]
[window_manager] Roll forward to new libchrome

BUG=chromium-os:14304
TEST=build, unit tests

Change-Id: I8e08e3eedb22c6441b9289bbba775e16a63f3ac7
Reviewed-on: http://gerrit.chromium.org/gerrit/825
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years agowm: Add Window::SetBounds(). 0.13.509.B
Daniel Erat [Fri, 6 May 2011 22:20:33 +0000 (15:20 -0700)]
wm: Add Window::SetBounds().

This is currently just a simple way to do a simultaneous
move and resize.  I will probably improve it after I remove
the legacy interface in the Window class that requires
managing the client and composited windows separately.

BUG=chromium-os:13963
TEST=using it in conjunction with an in-progress change

Change-Id: Ia31472c3ab1aa576bf379f1c96d76ab7d2b9929d
Reviewed-on: http://gerrit.chromium.org/gerrit/565
Reviewed-by: Greg Spencer <gspencer@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Center panels' transient windows onscreen.
Daniel Erat [Tue, 10 May 2011 01:24:51 +0000 (18:24 -0700)]
wm: Center panels' transient windows onscreen.

The window manager was formerly trying to center them over
the panel in question (while keeping them onscreen), but
this can look buggy when a transient window is larger than
the panel that owns it.

BUG=chromium-os:14361
TEST=updated existing tests; also manual testing (focused a panel, hit Ctrl-O, and observed that the file picker dialog was centered onscreen)

Change-Id: I1d4dbb70d5963eac626f676e6607d7075780b354
Reviewed-on: http://gerrit.chromium.org/gerrit/576
Reviewed-by: Greg Spencer <gspencer@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agoFix build.
Stéphane Marchesin [Mon, 9 May 2011 21:36:35 +0000 (14:36 -0700)]
Fix build.

Change-Id: Iac14b769335d0d488dde60c2ebebf7b7eb13eeac
Reviewed-on: http://gerrit.chromium.org/gerrit/551
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
3 years agoAdd pageflip support to the window manager.
Stéphane Marchesin [Sat, 7 May 2011 00:42:45 +0000 (17:42 -0700)]
Add pageflip support to the window manager.

Change-Id: I9e79634853d81130b83080d1ee623b922036f4b7
Reviewed-on: http://gerrit.chromium.org/gerrit/482
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
3 years agowm: Recenter login wizard window on screen resize.
Daniel Erat [Fri, 6 May 2011 01:03:34 +0000 (18:03 -0700)]
wm: Recenter login wizard window on screen resize.

We were previously updating the position of login entries,
but not doing anything similar for the window used for the
OOBE and picture-taking.

BUG=chromium-os:13848
TEST=manual: checked that oobe window is recentered on monitor hotplug; also added a unit test

Change-Id: I32d952fda82486e86a185d65353f1f2f118d4e41
Reviewed-on: http://gerrit.chromium.org/gerrit/411
Reviewed-by: Nikita Kostylev <nkostylev@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Don't mask new portion of overlay on screen resize.
Daniel Erat [Thu, 5 May 2011 21:19:54 +0000 (14:19 -0700)]
wm: Don't mask new portion of overlay on screen resize.

This fixes a bug where the code to enable or disable
compositing was leaving part of the compositing overlay
window masked out (via the shape extension) after a screen
resize.  This change makes us instead clear the shaped
region when compositing is enabled so that we don't need to
worry about updating the region after every resize.

BUG=chromium-os:14951
TEST=manual (plugged/unplugged larger external monitor while a context menu was open and checked that the screen was resized as expected) and added a unit test

Change-Id: I24ca27933e194bc62087fdfb716171e92caa8401
Reviewed-on: http://gerrit.chromium.org/gerrit/408
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
3 years agowm: Handle missing UnmapNotify events. 16/316/3
Daniel Erat [Thu, 5 May 2011 00:53:00 +0000 (17:53 -0700)]
wm: Handle missing UnmapNotify events.

Some crash reports and warning messages make me suspect that
we're sometimes not seeing UnmapNotify events for mapped
windows before they get destroyed.  This can lead to all
kinds of problems; in this particular case, FocusManager
appears to be dereferencing a stale pointer to a Window
object.  This change makes us try to handle this case as
gracefully as we can.

BUG=chromium-os:13792
TEST=wrote a test (but note that there are no repro steps for this; it's a pretty uncommon crash)

Change-Id: Ic11b1c9a54eab92fb680aa9c2f2b75477cdb08dc

3 years agowm: Display tooltips while screen is locked. 41/241/1
Daniel Erat [Wed, 4 May 2011 01:02:13 +0000 (18:02 -0700)]
wm: Display tooltips while screen is locked.

This makes the window manager composite windows with a
_NET_WM_WINDOW_TYPE_TOOLTIP atom in their
_NET_WM_WINDOW_TYPE property while the screen is locked.  We
formerly only composited screen locker windows and
info bubbles that had specifically asked to be composited.

BUG=chromium-os:6833
TEST=added a unit test; also manually checked that statusbar tooltips are now shown while the screen is locked

Change-Id: I6b47a54fb60a4487fbb8b2cf0fac344ca69a7855

3 years agowm: Update a lot of code to use structs from geometry.h.
Daniel Erat [Mon, 2 May 2011 17:35:29 +0000 (10:35 -0700)]
wm: Update a lot of code to use structs from geometry.h.

I'm updating most of the code here, with a few exceptions:
- Compositor (I'll do this in a separate change)
- deprecated Window::MoveClient() and MoveComposited()
  methods
- LayoutManager (I have a simplified rewrite of this
  in-progress for http://crosbug.com/13963)

Most of this change is completely mechanical, but I'm also
simplifying how we handle moving override-redirect windows'
compositing actors to the correct place onscreen and showing,
hiding, and restacking them: instead of doing this manually
in the WindowManager class, it's done in
Window::HandleConfigureNotify() and friends.

BUG=chromium-os:1822
TEST=ran existing tests

Review URL: http://codereview.chromium.org/6902072

Change-Id: I597e258ebf9382a84f98cc62b0bc2241330bd40b

3 years agowm: Add a way for classes to listen for modality changes.
Daniel Erat [Mon, 2 May 2011 17:29:02 +0000 (10:29 -0700)]
wm: Add a way for classes to listen for modality changes.

This adds a ModalityChangeListener interface that classes
can implement to get notifications from ModalityHandler
whenever we focus or unfocus a modal window.  I'm not wiring
this up to LayoutManager yet, but I'm using it in the new
implementation so we can e.g. disable keyboard shortcuts
while a panel has modal dialog up.

BUG=chromium-os:13963,chromium-os:9054
TEST=added, also built and tried it

Review URL: http://codereview.chromium.org/6893045

Change-Id: Ie1ef0aee637f58cc58175a8e152a01884e2e5463

3 years agochromeos-wm: Remove crosh-related files.
Daniel Erat [Fri, 29 Apr 2011 01:08:37 +0000 (18:08 -0700)]
chromeos-wm: Remove crosh-related files.

I've moved these into the crosh.git repository.

Change-Id: I7d8b98bf99bd494672824bbb1a272634f979a8e8

BUG=chromium-os:7741
TEST=built chromeos-wm

Review URL: http://codereview.chromium.org/6904114

3 years agocrosh: Improve the ssh command.
Elly Jones [Thu, 28 Apr 2011 19:19:58 +0000 (15:19 -0400)]
crosh: Improve the ssh command.

Add support for -D, -L, -N, and -i, per review from drewry@google.com; rewrite
the ssh command so we don't have to parse ssh command-line options.

Change-Id: I281493c11d0bad43610520eafd8e475b76e94ddc

BUG=None
TEST=Adhoc
Run it :)

Signed-off-by: Elly Jones <ellyjones@chromium.org>
Signed-off-by: Will Drewry <wad@chromium.org>
Review URL: http://codereview.chromium.org/6880253

3 years agoProvide an "autest" crosh command.
Darin Petkov [Wed, 27 Apr 2011 23:50:24 +0000 (16:50 -0700)]
Provide an "autest" crosh command.

It initiates an update check to the Omaha test server.

BUG=chromium-os:14567
TEST=ran on the device

Change-Id: Ibdc6d143cbac110b0b2d9cabfc58458aa809dff0

Review URL: http://codereview.chromium.org/6893070

3 years agoUse NEAREST filtering in the GL backend when the transform is 1:1.
Stéphane Marchesin [Wed, 27 Apr 2011 20:23:39 +0000 (13:23 -0700)]
Use NEAREST filtering in the GL backend when the transform is 1:1.

All GPUs exhibit some form of non-identityness when doing linear filtering with a 1:1 transform (usually due to rounding in the interpolation). This is visible in http://tft.vanity.dk/monitorTest_scale.html ; when compositing is enabled some more artifacts appear.

Change-Id: I29d2a201c119ab94cd4eeede46bd4e97ae573571

BUG=chromeos-partner:2927
TEST=Went to http://tft.vanity.dk/monitorTest_scale.html, the artifacts dont come & go as compositing is disabled/enabled. There are permanent artifacts but that's another bug.

Review URL: http://codereview.chromium.org/6893061

3 years agocrosh: ignore sigint
rginda [Mon, 25 Apr 2011 23:11:33 +0000 (16:11 -0700)]
crosh: ignore sigint

Change-Id: Iefc3518e1819377b9700edbc3999d83b84019ee0

BUG=chromium-os:13120
TEST=manual test in chroot

Review URL: http://codereview.chromium.org/6893009

3 years agowm: Add ResizeBox class.
Daniel Erat [Mon, 25 Apr 2011 22:42:35 +0000 (15:42 -0700)]
wm: Add ResizeBox class.

This adds a new class (just a simple wrapper around
ImageGrid) that can be used to display a box while resizing
an object and makes the panel code use it.  Before, we just
drew a plain blue box without any borders.

BUG=chromium-os:13963
TEST=manual testing (resized a panel)

Review URL: http://codereview.chromium.org/6905004

Change-Id: I1583b2e4d991783972a667aefb16c791a1f9ea38

3 years agowm: Synchronize all animations added in the same frame.
Daniel Erat [Fri, 22 Apr 2011 19:29:46 +0000 (12:29 -0700)]
wm: Synchronize all animations added in the same frame.

When scheduling a new animation, we used to use the current
time as the animation's starting time.  This made it
impossible to reliably make multiple animations proceed in
lockstep, as there's an unavoidable delay between when each
animation is scheduled.  As a result, we'd end up with ugly
effects like the small empty black gap that'd often be
visible between windows in the Alt-Tab animation.  (Note that
the black gap still exists after this change, but it's now an
artifact of the way that the current LayoutManager does
animations rather than inherent to the compositor -- the gap
is gone in my in-progress LayoutManager rewrite).

This change makes us cache a timestamp the first time that
an animation is added between frames and reuse it for all
subsequently-added animations so they'll all be
synchronized.

Change-Id: I0182a0622cbb84541035535142df0c75e05b937b

BUG=chromium-os:13963
TEST=added a test; also manual inspection that there's no empty gap visible between windows on alt-tab with my not-yet-committed LayoutManager rewrite

Review URL: http://codereview.chromium.org/6880138

3 years agowm: Add ScopedCompositingRequest.
Daniel Erat [Fri, 22 Apr 2011 17:18:29 +0000 (10:18 -0700)]
wm: Add ScopedCompositingRequest.

This adds an object that registers a request to force
compositing in its constructor and withdraws it in its
destructor.  This simplifies some code that I'm writing.

Change-Id: I8652cdc2809c594092cfc59f531260eff9ad823a

BUG=chromium-os:13963
TEST=built and ran it

Review URL: http://codereview.chromium.org/6900010

3 years agowm: Notify on all fetched pixmaps instead of just initial. 0.13.434.B
Daniel Erat [Fri, 22 Apr 2011 00:57:36 +0000 (17:57 -0700)]
wm: Notify on all fetched pixmaps instead of just initial.

The WindowManager class used to only notify event consumers
when a window's initial pixmap was fetched.  This change
makes it also notify them when the pixmap has been reset
after a resize.

BUG=chromium-os:13963
TEST=updated and ran existing tests

Review URL: http://codereview.chromium.org/6873080

Change-Id: I96c88af268f84c8038f1f009517c4507317a38c3

3 years agowm: Fix window_manager_test breakage from bda18ae8.
Daniel Erat [Fri, 22 Apr 2011 00:33:47 +0000 (17:33 -0700)]
wm: Fix window_manager_test breakage from bda18ae8.

A test was depending on a key binding that got removed.

Change-Id: I98d518bfa869270a72c6774230db0f7fdc07b075

BUG=none
TEST=tests pass now

Review URL: http://codereview.chromium.org/6900007

3 years agoStop calling monitor_reconfigure from the window manager.
Stéphane Marchesin [Fri, 22 Apr 2011 00:23:40 +0000 (17:23 -0700)]
Stop calling monitor_reconfigure from the window manager.

Change-Id: I000a1166e63281574d2ea06470cdd7a9f3790f81

BUG=None.
TEST=Compiled and ran the WM on mario.

Review URL: http://codereview.chromium.org/6896008

3 years agocrosh: automatically restart entd when providing a new extension CA
Ken Mixter [Wed, 20 Apr 2011 03:12:27 +0000 (20:12 -0700)]
crosh: automatically restart entd when providing a new extension CA

Change-Id: I0dd394e15a41f7dc381ce902a31a3f425dad0887

BUG=none
TEST=
1) remove current CA
2) log in
3) verify entd does not start and options is unusable
4) open crosh
5) do enterprise_ca_approve
6) verfy entd has restarted and options is usable without logging out

Review URL: http://codereview.chromium.org/6878066

3 years agochromeos-wm: Add cros secure_certificates flag to test pkcs11 in chrome
Ken Mixter [Wed, 20 Apr 2011 01:01:58 +0000 (18:01 -0700)]
chromeos-wm: Add cros secure_certificates flag to test pkcs11 in chrome

Enabling this "lab" changes Chrome, entd, and crytohome behavior so
that Chrome can use opencryptoki to store certificates.

Change-Id: Iadc1b2c52388b7a239b9ce7eb0ca676111db9d24

BUG=none
TEST=
secure_certificates on - enables
secure_certificates off - disables
secure_certificates - displays current status

Review URL: http://codereview.chromium.org/6881063

3 years agoRemove color calibration from the window manager.
Stéphane Marchesin [Wed, 20 Apr 2011 00:33:50 +0000 (17:33 -0700)]
Remove color calibration from the window manager.

Change-Id: Icc60772afef57afd0ed114ebc4b6d4d246a1a7af

BUG=chromium-os:10138
TEST=

Review URL: http://codereview.chromium.org/6865032

3 years agoDisable unredirection during screen resizes.
Stéphane Marchesin [Thu, 14 Apr 2011 03:14:20 +0000 (20:14 -0700)]
Disable unredirection during screen resizes.

Change-Id: I200aae31b4fc0853ec05c7ba31b71e58924c5f2d

BUG=None
TEST=Plug/unplug an external screen, the screen shouldn't stay black after plug/unplug.

Review URL: http://codereview.chromium.org/6853005

3 years agowm: Disable Ctrl-Alt-T until first browser window is up.
Daniel Erat [Thu, 14 Apr 2011 01:48:23 +0000 (18:48 -0700)]
wm: Disable Ctrl-Alt-T until first browser window is up.

There's a weird state the first time a new user logs in
where the _CHROME_LOGGED_IN property is set on the root
window but the camera wizard is still being shown.  This
change moves the Ctrl-Alt-T shortcut for opening a terminal
from WindowManager to LayoutManager, so we can disable it
until the user has finished taking their picture and a
browser window is being shown.

Change-Id: I4c1ddf3349cfcc5662306e1f3d5a607c6eff5304

BUG=chromium-os:12118
TEST=logged in with a new user and checked that ctrl-alt-t did nothing on the camera screen but worked afterwards

Review URL: http://codereview.chromium.org/6854010

3 years agowm: Clean up command-running code.
Daniel Erat [Thu, 14 Apr 2011 00:47:36 +0000 (17:47 -0700)]
wm: Clean up command-running code.

This just factors out the code that we use to run commands
so I can move the terminal hotkey into LayoutManager in a
later change.

Change-Id: I441c8aafa34d3173d4a1a6582d12e123ed1cb1b2

BUG=chromium-os:12118
TEST=checked that we still run commands correctly

Review URL: http://codereview.chromium.org/6854007

3 years agowm: Use DLOG instead of LOG for Xlib errors.
Daniel Erat [Thu, 14 Apr 2011 00:17:56 +0000 (17:17 -0700)]
wm: Use DLOG instead of LOG for Xlib errors.

In general, these come from unavoidable (at least without
grabbing the server all the time) races.  There's pretty
much no way to avoid them when a window gets unmapped.

Also avoid an extra round-trip to the X server to get a
timestamp that we don't use when we're closing a window that
doesn't have any transients.

Change-Id: I3ab374e9f0c4f9d0baf14a4bdc91786acaa5afe9

BUG=chromium-os:8450
TEST=checked that we don't log as many errors in non-debug builds; ran existing tests

Review URL: http://codereview.chromium.org/6831006

3 years agowm: Add support for forcing compositing.
Daniel Erat [Wed, 13 Apr 2011 23:18:25 +0000 (16:18 -0700)]
wm: Add support for forcing compositing.

Things are currently glitchy if we exit the non-composited
mode by resizing a fullscreen window to instead just cover a
portion of the screen, since the X window often gets resized
before we get a chance to redraw and show the composited
scene.

This change adds an IncrementCompositingRequests() method to
WindowManager that can be used to force us to composite (and
that triggers a single composited draw if we're not already
compositing).  This can be called before we do a resize to
ensure that the ugliness that goes on in the uncomposited
world isn't visible onscreen.  At this point, we'll continue
compositing while we wait for the resized window to be
repainted by the client.

BUG=chromium-os:13963
TEST=manually tested it with the new layout code that i'm working on and checked that there's no ugly flicker when i go from maximized to non-maximized mode; also added some tests

Review URL: http://codereview.chromium.org/6843001

Change-Id: I05cab9fa1e0080d261a6484c2734f618cf70e6e7

3 years agowm: Fix bug where transients can end up in wrong position.
Daniel Erat [Wed, 13 Apr 2011 23:08:29 +0000 (16:08 -0700)]
wm: Fix bug where transients can end up in wrong position.

This fixes a bug where we weren't updating a window's
composited position correctly in response to
ConfigureRequest events that came in before the window was
mapped.  This was unnoticeable for most windows, but became
an issue for transient windows after I changed
TransientWindowCollection to use windows' composited (rather
than X) positions to determine their offsets from their
owners in d1e1347a.

Change-Id: I9da8a5a253490ee1e1680b5a705348939e943ccf

BUG=chromium-os:14075
TEST=manual; also added a test

Review URL: http://codereview.chromium.org/6851004

3 years agowm: Support keeping shadows under windows while restacking.
Daniel Erat [Tue, 12 Apr 2011 22:49:13 +0000 (15:49 -0700)]
wm: Support keeping shadows under windows while restacking.

When restacking a window, StackingManager previously only
supported putting its shadow on the bottom of a layer.  This
changes adds support for keeping the shadow directly under
the window -- previously, we just reached around
StackingManager and messed directly with the Window object
when we needed to do this.

I also added some enums to replace ambiguous bool arguments
and added some more tests.

Change-Id: Iab104024425badd1c1fa8c20df89dc4e1941c601

BUG=none
TEST=added; also did manual testing and didn't notice anything different

Review URL: http://codereview.chromium.org/6831002

3 years agowm: Refactor Shadow class into ImageGrid.
Daniel Erat [Tue, 12 Apr 2011 21:57:52 +0000 (14:57 -0700)]
wm: Refactor Shadow class into ImageGrid.

I'm going to need scalable 3x3 grids of images for drawing
translucent resize guides that look nicer than the simple
solid rectangles that we use currently.  This is pretty
close to what we use for drop shadows, so I've refactored
that code so that it can be used elsewhere.

BUG=none
TEST=added a bunch of tests, also built and ran it and checked that shadows look the same as before

Review URL: http://codereview.chromium.org/6810036

Change-Id: Iad8edef6238efd2c5bfa3b43ae4f14682c2ba2cd