xiaoxiang781216 commented on code in PR #6576:
URL: https://github.com/apache/incubator-nuttx/pull/6576#discussion_r916398372


##########
drivers/video/vnc/vnc_fbdev.c:
##########
@@ -598,9 +600,39 @@ static inline int vnc_wait_start(int display)
 int up_fbinitialize(int display)
 {
   int ret;
+  FAR struct vnc_session_s *session;
+#ifdef CONFIG_VNCSERVER_TOUCH
+  char devname[NAME_MAX];
+#endif
 
   DEBUGASSERT(display >= 0 && display < RFB_MAX_DISPLAYS);
 
+  /* Save the input callout function information in the session structure. */
+
+  session           = g_vnc_sessions[display];
+#ifdef CONFIG_VNCSERVER_TOUCH
+
+  ret = snprintf(devname, NAME_MAX, CONFIG_VNCSERVER_TOUCH_DEVNAME "%d",
+                 display);
+
+  if (ret < 0)
+    {
+      gerr("ERROR: Format vnc touch driver path failed.\n");
+      return ret;
+    }
+
+  ret = vnc_touch_register(devname, session);
+
+  if (ret < 0)
+    {
+      gerr("ERROR: Initial vnc touch driver failed.\n");
+      return ret;
+    }
+
+  session->mouseout = vnc_touch_event;
+#endif
+  session->arg      = session;
+
   /* Start the VNC server kernel thread. */
 
   ret = vnc_start_server(display);

Review Comment:
   let's unregister touch screen driver in case of fail



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to