Set surface owner for widget ANR 56/199256/1
authorhyunho <hhstark.kang@samsung.com>
Fri, 8 Feb 2019 01:37:01 +0000 (10:37 +0900)
committerhyunho <hhstark.kang@samsung.com>
Fri, 8 Feb 2019 01:58:02 +0000 (10:58 +0900)
To manage ANR, window manager should know surface owner

Change-Id: Icfd8f7a423ddf33b92eaf3183786688aa4828c64
Signed-off-by: hyunho <hhstark.kang@samsung.com>
screen_connector_remote_surface/remote_surface.cc
screen_connector_remote_surface/remote_surface.h
screen_connector_remote_surface/trs_interface.h
screen_connector_remote_surface/trs_internal.h
screen_connector_remote_surface/trs_mock_internal.h
screen_connector_remote_surface_evas/remote_surface_evas.cc
screen_connector_watcher/src/screen_connector_toolkit.cc

index 7fd2bbd..78ec210 100644 (file)
@@ -331,4 +331,8 @@ int RemoteSurface::SetRemoteRender() {
     impl_->inst_id_.c_str());
 }
 
+void RemoteSurface::SetSurfaceOwner(struct wl_surface* surface) {
+  impl_->surface_->SetSurfaceOwner(surface);
+}
+
 }  // namespace screen_connector
index ec2779a..1acf7a5 100644 (file)
@@ -81,6 +81,7 @@ class EXPORT_API RemoteSurface : public IBufferEvent {
   bool IsRemoteRender() const;
   void ClearRemoteRender();
   int SetRemoteRender();
+  void SetSurfaceOwner(struct wl_surface* surface);
   void SetBlock(bool is_block);
   virtual void Unbind();
   bool IsBound() const;
index 12696de..faa47f0 100644 (file)
@@ -42,6 +42,7 @@ class EXPORT_API ITRS {
   virtual void TransferTouchCancel() = 0;
   virtual void TransferMouseUp(int x, int y, unsigned int timestamp) = 0;
   virtual void SetRemoteRender(bool set) = 0;
+  virtual void SetSurfaceOwner(struct wl_surface* surface) = 0;
   virtual void SetChangedBufferEventFilter(int filter) = 0;
   virtual void AddListener(IEventListener* listener) = 0;
   virtual void Redirect() = 0;
index 593a3de..e282439 100644 (file)
 #include "screen_connector_remote_surface/handle.h"
 #include "screen_connector_remote_surface/trs_interface.h"
 
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "SC_REMOTE_SURFACE"
+
 namespace screen_connector {
 
 class TRS : public Handle<struct tizen_remote_surface*>, public ITRS {
@@ -74,6 +80,11 @@ class TRS : public Handle<struct tizen_remote_surface*>, public ITRS {
       tizen_remote_surface_set_remote_render(GetRaw(), 0);
   }
 
+  void SetSurfaceOwner(struct wl_surface* surface) override {
+    tizen_remote_surface_set_owner(GetRaw(), surface);
+    LOGW("set owner for trs %p wl_surface %p ", GetRaw(), surface);
+  }
+
   void SetChangedBufferEventFilter(int filter) override {
     tizen_remote_surface_set_changed_buffer_event_filter(GetRaw(), filter);
   }
index e08d765..2adb699 100644 (file)
@@ -53,6 +53,9 @@ class TRSMock : public TRS {
   void SetRemoteRender(bool set) override {
   }
 
+  void SetSurfaceOwner(struct wl_surface* surface) override {
+  }
+
   void SetChangedBufferEventFilter(int filter) override {
   }
 
index b86d960..095fcb1 100644 (file)
@@ -485,6 +485,8 @@ void RemoteSurfaceEvas::OnBufferChanged(int type, std::shared_ptr<WlBuffer> tbm,
     } else {
       unsigned int win_id = ecore_wl2_window_id_get(wlWin);
       impl_->winVisibility_map_[win_id] = GetVisibility(win_id);
+      if (impl_->parent_->GetType() == RemoteSurface::WIDGET)
+        impl_->parent_->SetSurfaceOwner(ecore_wl2_window_surface_get(wlWin));
     }
     isAdded = true;
   }
index 4b63845..54def7e 100644 (file)
@@ -320,3 +320,11 @@ screen_connector_toolkit_dispose_buffer(screen_connector_toolkit_h handle,
   rs->DisposeBuffer(tbm);
   return 0;
 }
+
+extern "C" EXPORT_API int
+screen_connector_toolkit_set_owner(screen_connector_toolkit_h handle,
+    struct wl_surface* surface) {
+  RemoteSurfaceToolkit* rs = static_cast<RemoteSurfaceToolkit*>(handle);
+  rs->SetSurfaceOwner(surface);
+  return 0;
+}
\ No newline at end of file