diff options
author | Yaniv Kamay <ykamay@redhat.com> | 2009-12-28 00:17:42 +0200 |
---|---|---|
committer | Yaniv Kamay <ykamay@redhat.com> | 2009-12-28 12:35:32 +0200 |
commit | cced1b1cff4002e2402936ff033ce985668e59e5 (patch) | |
tree | 002c66212e423c5536080e5dd6f6d046501919df /client/screen.cpp | |
parent | 941ba9bf5ca9a8812e7893848943c2cec6a5e6a6 (diff) | |
download | spice-cced1b1cff4002e2402936ff033ce985668e59e5.tar.gz spice-cced1b1cff4002e2402936ff033ce985668e59e5.tar.xz spice-cced1b1cff4002e2402936ff033ce985668e59e5.zip |
client: improve screen resizing
Screen now have to modes locked and unlocked.
In unlocked mode, the application can change screen size and so
reduce resolution changing. The application can also choose to
change window size while not in full screen mode.
In locked mode the application must ewtain locker screen size
setting.
Diffstat (limited to 'client/screen.cpp')
-rw-r--r-- | client/screen.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/client/screen.cpp b/client/screen.cpp index e9bae8b2..29b40bf6 100644 --- a/client/screen.cpp +++ b/client/screen.cpp @@ -83,6 +83,7 @@ RedScreen::RedScreen(Application& owner, int id, const std::wstring& name, int w , _periodic_update (false) , _key_interception (false) , _update_by_timer (true) + , _size_locked (false) , _forec_update_timer (0) , _update_timer (new UpdateTimer(this)) , _composit_area (NULL) @@ -148,7 +149,7 @@ void RedScreen::show(bool activate, RedScreen* pos) RedScreen* RedScreen::ref() { - _refs++; + ++_refs; return this; } @@ -179,7 +180,7 @@ void RedScreen::adjust_window_rect(int x, int y) _window.move_and_resize(x, y, _size.x, _size.y); } -void RedScreen::set_mode(int width, int height, int depth) +void RedScreen::resize(int width, int height) { RecurciveLock lock(_update_lock); _size.x = width; @@ -204,6 +205,18 @@ void RedScreen::set_mode(int width, int height, int depth) notify_new_size(); } +void RedScreen::lock_size() +{ + ASSERT(!_size_locked); + _size_locked = true; +} + +void RedScreen::unlock_size() +{ + _size_locked = false; + _owner.on_screen_unlocked(*this); +} + void RedScreen::set_name(const std::wstring& name) { if (!name.empty()) { |