aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/ephyr/hostx.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/hostx.c')
-rwxr-xr-x[-rw-r--r--]xorg-server/hw/kdrive/ephyr/hostx.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index 4f48770a6..8aadb2aab 100644..100755
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -38,9 +38,11 @@
#include <time.h>
#include <err.h>
+#ifndef _MSC_VER
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/time.h>
+#endif
#include <X11/keysym.h>
#include <xcb/xcb.h>
@@ -136,7 +138,11 @@ hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num)
void
hostx_set_display_name(char *name)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
HostX.server_dpy_name = strdup(name);
+#endif
}
void
@@ -475,6 +481,9 @@ hostx_init(void)
xcb_free_pixmap(HostX.conn, cursor_pxm);
}
+#ifdef _MSC_VER
+ __asm int 3;
+#else
/* Try to get share memory ximages for a little bit more speed */
shm_rep = xcb_get_extension_data(HostX.conn, &xcb_shm_id);
if (!shm_rep || !shm_rep->present || getenv("XEPHYR_NO_SHM")) {
@@ -507,6 +516,7 @@ hostx_init(void)
shmdt(shminfo.shmaddr);
shmctl(shminfo.shmid, IPC_RMID, 0);
}
+#endif
xcb_flush(HostX.conn);
@@ -633,7 +643,7 @@ hostx_screen_init(KdScreenInfo *screen,
Bool shm_success = FALSE;
if (!scrpriv) {
- fprintf(stderr, "%s: Error in accessing hostx data\n", __func__);
+ fprintf(stderr, "%s: Error in accessing hostx data\n", __FUNCTION__);
exit(1);
}
@@ -646,10 +656,14 @@ hostx_screen_init(KdScreenInfo *screen,
*/
if (HostX.have_shm) {
+#ifdef _MSC_VER
+ __asm int 3;
+#else
xcb_shm_detach(HostX.conn, scrpriv->shminfo.shmseg);
xcb_image_destroy(scrpriv->ximg);
shmdt(scrpriv->shminfo.shmaddr);
shmctl(scrpriv->shminfo.shmid, IPC_RMID, 0);
+#endif
}
else {
free(scrpriv->ximg->data);
@@ -660,6 +674,9 @@ hostx_screen_init(KdScreenInfo *screen,
}
if (!ephyr_glamor && HostX.have_shm) {
+#ifdef _MSC_VER
+__asm int 3;
+#else
scrpriv->ximg = xcb_image_create_native(HostX.conn,
width,
buffer_height,
@@ -692,6 +709,7 @@ hostx_screen_init(KdScreenInfo *screen,
FALSE);
shm_success = TRUE;
}
+#endif
}
if (!ephyr_glamor && !shm_success) {
@@ -850,10 +868,14 @@ hostx_paint_rect(KdScreenInfo *screen,
}
if (HostX.have_shm) {
+#ifdef _MSC_VER
+ __asm int 3;
+#else
xcb_image_shm_put(HostX.conn, scrpriv->win,
HostX.gc, scrpriv->ximg,
scrpriv->shminfo,
sx, sy, dx, dy, width, height, FALSE);
+#endif
}
else {
xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, scrpriv->ximg,
@@ -867,6 +889,9 @@ static void
hostx_paint_debug_rect(KdScreenInfo *screen,
int x, int y, int width, int height)
{
+#ifdef _MSC_VER
+ __asm int 3;
+#else
EphyrScrPriv *scrpriv = screen->driver;
struct timespec tspec;
xcb_rectangle_t rect = { .x = x, .y = y, .width = width, .height = height };
@@ -888,6 +913,7 @@ hostx_paint_debug_rect(KdScreenInfo *screen,
/* nanosleep seems to work better than usleep for me... */
nanosleep(&tspec, NULL);
+#endif
}
void