summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/controller_hooks.hpp3
-rw-r--r--src/wayland_ivi_wm.cpp6
-rw-r--r--src/wayland_ivi_wm.hpp1
-rw-r--r--src/window_manager.cpp15
4 files changed, 16 insertions, 9 deletions
diff --git a/src/controller_hooks.hpp b/src/controller_hooks.hpp
index f259089..dd0a3aa 100644
--- a/src/controller_hooks.hpp
+++ b/src/controller_hooks.hpp
@@ -28,10 +28,9 @@ class WindowManager;
struct controller_hooks
{
- WindowManager *app;
+ WindowManager *wmgr;
void surface_created(uint32_t surface_id);
-
void surface_removed(uint32_t surface_id);
void surface_visibility(uint32_t surface_id, uint32_t v);
void surface_destination_rectangle(uint32_t surface_id, uint32_t x, uint32_t y, uint32_t w, uint32_t h);
diff --git a/src/wayland_ivi_wm.cpp b/src/wayland_ivi_wm.cpp
index f64ec03..8b04c64 100644
--- a/src/wayland_ivi_wm.cpp
+++ b/src/wayland_ivi_wm.cpp
@@ -531,6 +531,11 @@ void controller::create_screen(struct wl_output *output)
this->screen = std::make_unique<struct screen>(0, this, output);
}
+void controller::get_surface_properties(uint32_t surface_id, int param)
+{
+ ivi_wm_surface_get(this->proxy.get(), surface_id, param);
+}
+
void controller::layer_created(uint32_t id)
{
HMI_DEBUG("wm", "compositor::controller @ %p layer %u (%x)", this->proxy.get(), id, id);
@@ -591,6 +596,7 @@ void controller::surface_size_changed(uint32_t id, int32_t width,
HMI_DEBUG("wm", "compositor::surface %s @ %d w %i h %i", __func__, id,
width, height);
this->sprops[id].size = size{uint32_t(width), uint32_t(height)};
+ this->surfaces[id]->set_source_rectangle(0, 0, width, height);
}
void controller::surface_added_to_layer(uint32_t layer_id, uint32_t surface_id)
diff --git a/src/wayland_ivi_wm.hpp b/src/wayland_ivi_wm.hpp
index a430927..b515a06 100644
--- a/src/wayland_ivi_wm.hpp
+++ b/src/wayland_ivi_wm.hpp
@@ -292,6 +292,7 @@ struct controller : public wayland_proxy<struct ivi_wm>
void layer_create(uint32_t id, int32_t w, int32_t h);
void surface_create(uint32_t id);
void create_screen(struct wl_output *output);
+ void get_surface_properties(uint32_t surface_id, int param = 0);
// Events
void surface_visibility_changed(uint32_t id, int32_t visibility);
diff --git a/src/window_manager.cpp b/src/window_manager.cpp
index c44210f..aa42d82 100644
--- a/src/window_manager.cpp
+++ b/src/window_manager.cpp
@@ -184,12 +184,12 @@ int WindowManager::init()
// This protocol needs the output, so lets just add our mapping here...
this->controller->add_proxy_to_id_mapping(
- this->outputs.back()->proxy.get(),
+ this->outputs.front()->proxy.get(),
wl_proxy_get_id(reinterpret_cast<struct wl_proxy *>(
- this->outputs.back()->proxy.get())));
+ this->outputs.front()->proxy.get())));
// Create screen
- this->controller->create_screen(this->outputs.back()->proxy.get());
+ this->controller->create_screen(this->outputs.front()->proxy.get());
// Set display to controller
this->controller->display = this->display;
@@ -574,6 +574,8 @@ void WindowManager::send_event(char const *evname, char const *label, char const
*/
void WindowManager::surface_created(uint32_t surface_id)
{
+ this->controller->get_surface_properties(surface_id, IVI_WM_PARAM_SIZE);
+
auto layer_id = this->layers.get_layer_id(surface_id);
if (!layer_id)
{
@@ -742,8 +744,6 @@ void WindowManager::surface_set_layout(int surface_id, const std::string& area)
layer_id);
// set destination to the display rectangle
- s->set_source_rectangle(0, 0, w, h);
- this->layout_commit();
s->set_destination_rectangle(x, y, w, h);
// update area information
@@ -1292,6 +1292,7 @@ WMError WindowManager::doEndDraw(unsigned req_num)
HMI_SEQ_DEBUG(req_num, "visible %s", act.role.c_str());
//this->lm_enddraw(act.role.c_str());
}
+ this->layout_commit();
// Change current state
this->changeCurrentState(req_num);
@@ -1771,12 +1772,12 @@ const char* WindowManager::kDefaultOldRoleDb = "{ \
*/
void controller_hooks::surface_created(uint32_t surface_id)
{
- this->app->surface_created(surface_id);
+ this->wmgr->surface_created(surface_id);
}
void controller_hooks::surface_removed(uint32_t surface_id)
{
- this->app->surface_removed(surface_id);
+ this->wmgr->surface_removed(surface_id);
}
void controller_hooks::surface_visibility(uint32_t /*surface_id*/,