Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dcommander committed Jul 17, 2024
2 parents 716abdd + 31a882e commit c4d63e6
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 62 deletions.
5 changes: 2 additions & 3 deletions unix/Xvnc/programs/Xserver/genpatch
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash

PROJECT=xorg-server-1.20.14
PROJECT=xserver-dbf6d1c24a00a1f598756c71028876ff2b3db17f
FILE=$PROJECT.tar.gz
URL=https://www.x.org/releases/individual/xserver
URL=https://gitlab.freedesktop.org/xorg/xserver/-/archive/dbf6d1c24a00a1f598756c71028876ff2b3db17f/
SRCDIR=`dirname $0`

. $SRCDIR/../../genpatch | filterdiff -p1 -x Xserver/include/dix-config.h.in -x Xserver/include/version-config.h.in -x Xserver/include/xkb-config.h.in >$SRCDIR/turbovnc.patch
31 changes: 26 additions & 5 deletions unix/Xvnc/programs/Xserver/os/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ SOFTWARE.
#include <stdio.h>
#include <stdlib.h>

#include <sys/stat.h>

#ifndef WIN32
#include <sys/socket.h>

Expand Down Expand Up @@ -1000,15 +1002,34 @@ MakeClientGrabPervious(ClientPtr client)
void
ListenOnOpenFD(int fd, int noxauth)
{
char port[256];
char port[PATH_MAX];
XtransConnInfo ciptr;
const char *display_env = getenv("DISPLAY");

if (display_env && (strncmp(display_env, "/tmp/launch", 11) == 0)) {
/* Make the path the launchd socket if our DISPLAY is set right */
strcpy(port, display_env);
/* First check if display_env matches a <absolute path to unix socket>[.<screen number>] scheme (eg: launchd) */
if (display_env && display_env[0] == '/') {
struct stat sbuf;

strlcpy(port, display_env, sizeof(port));

/* If the path exists, we don't have do do anything else.
* If it doesn't, we need to check for a .<screen number> to strip off and recheck.
*/
if (0 != stat(port, &sbuf)) {
char *dot = strrchr(port, '.');
if (dot) {
*dot = '\0';

if (0 != stat(port, &sbuf)) {
display_env = NULL;
}
} else {
display_env = NULL;
}
}
}
else {

if (!display_env) {
/* Just some default so things don't break and die. */
snprintf(port, sizeof(port), ":%d", atoi(display));
}
Expand Down
6 changes: 6 additions & 0 deletions unix/Xvnc/programs/Xserver/present/present_scmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window)
if (!screen_priv->info)
return NULL;

if (!screen_priv->info->get_crtc)
return NULL;

return (*screen_priv->info->get_crtc)(window);
}

Expand Down Expand Up @@ -206,6 +209,9 @@ present_flush(WindowPtr window)
if (!screen_priv->info)
return;

if (!screen_priv->info->flush)
return;

(*screen_priv->info->flush) (window);
}

Expand Down
Loading

0 comments on commit c4d63e6

Please sign in to comment.