diff options
Diffstat (limited to 'sample')
-rw-r--r-- | sample/simple-egl/src/simple-egl.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/sample/simple-egl/src/simple-egl.cpp b/sample/simple-egl/src/simple-egl.cpp index 0f601c2..6a2d0d8 100644 --- a/sample/simple-egl/src/simple-egl.cpp +++ b/sample/simple-egl/src/simple-egl.cpp @@ -60,7 +60,7 @@ uint32_t g_id_ivisurf = 9009; long port = 1700; string token = string("wm"); -const char* role = "test"; +const char* main_role = "test"; LibHomeScreen* hs; LibWindowmanager *wm; @@ -532,18 +532,19 @@ init_wm(LibWindowmanager *wm, struct window *window) return -1; } - g_id_ivisurf = wm->requestSurface(role); + g_id_ivisurf = wm->requestSurface(main_role); if (g_id_ivisurf < 0) { HMI_ERROR(log_prefix,"wm request surface failed "); return -1; } HMI_DEBUG(log_prefix,"IVI_SURFACE_ID: %d ", g_id_ivisurf); - wm->setSyncDrawHandler([wm, window](const char* role, const char* area, const Rect& rect) { + wm->setSyncDrawHandler([wm, window](const char* role, const char* area, Rect rect) { - HMI_DEBUG(log_prefix,"Surface %s got syncDraw! Area: %s. ", role, area); + HMI_DEBUG(log_prefix,"Surface %s got syncDraw! Area: %s. w:%d, h:%d", role, area, rect.width(), rect.height()); - window->geometry.width = rect.width(); - window->geometry.width = rect.height(); + wl_egl_window_resize(window->native, rect.width(), rect.height(), 0, 0); + window->geometry.width = rect.width(); + window->geometry.height = rect.height(); wm->endDraw(role); @@ -566,23 +567,20 @@ init_wm(LibWindowmanager *wm, struct window *window) wm->endDraw(obj);*/ }); - wm->setActivatedHandler([](const char* role){ - HMI_DEBUG(log_prefix, "activated : %s", role); + wm->setActiveHandler([](const char* role, bool active){ + HMI_DEBUG(log_prefix, "role %s, active : %d", role, active); }); - wm->setInactivedHandler([](const char* role){ - HMI_DEBUG(log_prefix, "inactivated : %s", role); - }); - wm->setVisibleHandler([](const char* role){ - HMI_DEBUG(log_prefix, "visible : %s", role); - }); - wm->setInvisibleHandler([](const char* role){ - HMI_DEBUG(log_prefix, "invisible : %s", role); + wm->setVisibleHandler([](const char* role, bool visible){ + HMI_DEBUG(log_prefix, "role %s, visible : %d", role, visible); }); wm->setFlushDrawHandler([](const char* role){ HMI_DEBUG(log_prefix, "flushDraw : %s", role); }); - wm->setScreenUpdatedHandler([](const vector<string> &ids){ - HMI_DEBUG(log_prefix, "id : %s", ids[0].c_str()); + wm->setScreenUpdatedHandler([](const vector<string>& ids){ + if(ids.size() != 0) + HMI_DEBUG(log_prefix, "id : %s", ids[0].c_str()); + else + HMI_DEBUG(log_prefix, "no id"); }); @@ -603,8 +601,8 @@ init_hs(LibHomeScreen* hs){ HMI_DEBUG(log_prefix,"Event_TapShortcut application_name = %s ", application_name); if(strcmp(application_name, "Navigation") == 0) { - wm->activateWindow(role, "normal.full"); - HMI_DEBUG(log_prefix,"try to activesurface %s ", role); + wm->activateWindow(main_role); + HMI_DEBUG(log_prefix,"try to activesurface %s ", main_role); } }); @@ -631,7 +629,7 @@ main(int argc, char **argv) token = argv[2]; } - HMI_DEBUG(log_prefix,"app_name: %s, port: %d, token: %s. ", role, port, token.c_str()); + HMI_DEBUG(log_prefix,"app_name: %s, port: %d, token: %s. ", main_role, port, token.c_str()); display.display = wl_display_connect(NULL); assert(display.display); @@ -678,7 +676,7 @@ main(int argc, char **argv) sigaction(SIGINT, &sigint, NULL); eglSwapBuffers(window.display->egl.dpy, window.egl_surface); - wm->activateWindow(role, "normal.full"); + wm->activateWindow(main_role); /* The mainloop here is a little subtle. Redrawing will cause * EGL to read events so we can just call |