FreeRDP
xf_window.c File Reference
#include <freerdp/config.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/types.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <winpr/assert.h>
#include <winpr/thread.h>
#include <winpr/crt.h>
#include <winpr/string.h>
#include <freerdp/rail.h>
#include <freerdp/log.h>
#include "xf_gfx.h"
#include "xf_rail.h"
#include "xf_input.h"
#include "xf_keyboard.h"
#include "xf_utils.h"
#include <FreeRDP_Icon_256px.h>
#include "xf_window.h"

Macros

#define TAG   CLIENT_TAG("x11")
 
#define DEBUG_X11(...)
 
#define xf_icon_prop   FreeRDP_Icon_256px_prop
 
#define MWM_HINTS_FUNCTIONS   (1L << 0)
 
#define MWM_HINTS_DECORATIONS   (1L << 1)
 
#define MWM_HINTS_INPUT_MODE   (1L << 2)
 
#define MWM_HINTS_STATUS   (1L << 3)
 
#define MWM_FUNC_ALL   (1L << 0)
 
#define MWM_FUNC_RESIZE   (1L << 1)
 
#define MWM_FUNC_MOVE   (1L << 2)
 
#define MWM_FUNC_MINIMIZE   (1L << 3)
 
#define MWM_FUNC_MAXIMIZE   (1L << 4)
 
#define MWM_FUNC_CLOSE   (1L << 5)
 
#define MWM_DECOR_ALL   (1L << 0)
 
#define MWM_DECOR_BORDER   (1L << 1)
 
#define MWM_DECOR_RESIZEH   (1L << 2)
 
#define MWM_DECOR_TITLE   (1L << 3)
 
#define MWM_DECOR_MENU   (1L << 4)
 
#define MWM_DECOR_MINIMIZE   (1L << 5)
 
#define MWM_DECOR_MAXIMIZE   (1L << 6)
 
#define PROP_MOTIF_WM_HINTS_ELEMENTS   5
 

Functions

static void xf_SetWindowTitleText (xfContext *xfc, Window window, const char *name)
 
void xf_SendClientEvent (xfContext *xfc, Window window, Atom atom, unsigned int numArgs,...)
 
void xf_SetWindowMinimized (xfContext *xfc, xfWindow *window)
 
void xf_SetWindowFullscreen (xfContext *xfc, xfWindow *window, BOOL fullscreen)
 
BOOL xf_GetWindowProperty (xfContext *xfc, Window window, Atom property, int length, unsigned long *nitems, unsigned long *bytes, BYTE **prop)
 
BOOL xf_GetCurrentDesktop (xfContext *xfc)
 
BOOL xf_GetWorkArea (xfContext *xfc)
 
void xf_SetWindowDecorations (xfContext *xfc, Window window, BOOL show)
 
void xf_SetWindowUnlisted (xfContext *xfc, Window window)
 
static void xf_SetWindowPID (xfContext *xfc, Window window, pid_t pid)
 
static const char * get_shm_id (void)
 
Window xf_CreateDummyWindow (xfContext *xfc)
 
void xf_DestroyDummyWindow (xfContext *xfc, Window window)
 
xfWindow * xf_CreateDesktopWindow (xfContext *xfc, char *name, int width, int height)
 
void xf_ResizeDesktopWindow (xfContext *xfc, xfWindow *window, int width, int height)
 
void xf_DestroyDesktopWindow (xfContext *xfc, xfWindow *window)
 
void xf_SetWindowStyle (xfContext *xfc, xfAppWindow *appWindow, UINT32 style, UINT32 ex_style)
 
void xf_SetWindowText (xfContext *xfc, xfAppWindow *appWindow, const char *name)
 
static void xf_FixWindowCoordinates (xfContext *xfc, int *x, int *y, int *width, int *height)
 
int xf_AppWindowInit (xfContext *xfc, xfAppWindow *appWindow)
 
BOOL xf_AppWindowCreate (xfContext *xfc, xfAppWindow *appWindow)
 
void xf_SetWindowMinMaxInfo (xfContext *xfc, xfAppWindow *appWindow, int maxWidth, int maxHeight, int maxPosX, int maxPosY, int minTrackWidth, int minTrackHeight, int maxTrackWidth, int maxTrackHeight)
 
void xf_StartLocalMoveSize (xfContext *xfc, xfAppWindow *appWindow, int direction, int x, int y)
 
void xf_EndLocalMoveSize (xfContext *xfc, xfAppWindow *appWindow)
 
void xf_MoveWindow (xfContext *xfc, xfAppWindow *appWindow, int x, int y, int width, int height)
 
void xf_ShowWindow (xfContext *xfc, xfAppWindow *appWindow, BYTE state)
 
void xf_SetWindowRects (xfContext *xfc, xfAppWindow *appWindow, RECTANGLE_16 *rects, int nrects)
 
void xf_SetWindowVisibilityRects (xfContext *xfc, xfAppWindow *appWindow, UINT32 rectsOffsetX, UINT32 rectsOffsetY, RECTANGLE_16 *rects, int nrects)
 
void xf_UpdateWindowArea (xfContext *xfc, xfAppWindow *appWindow, int x, int y, int width, int height)
 
static void xf_AppWindowDestroyImage (xfAppWindow *appWindow)
 
void xf_DestroyWindow (xfContext *xfc, xfAppWindow *appWindow)
 
xfAppWindow * xf_AppWindowFromX11Window (xfContext *xfc, Window wnd)
 
UINT xf_AppUpdateWindowFromSurface (xfContext *xfc, gdiGfxSurface *surface)
 
BOOL xf_AppWindowResize (xfContext *xfc, xfAppWindow *appWindow)
 

Macro Definition Documentation

◆ DEBUG_X11

#define DEBUG_X11 (   ...)
Value:
do \
{ \
} while (0)

◆ MWM_DECOR_ALL

#define MWM_DECOR_ALL   (1L << 0)

◆ MWM_DECOR_BORDER

#define MWM_DECOR_BORDER   (1L << 1)

◆ MWM_DECOR_MAXIMIZE

#define MWM_DECOR_MAXIMIZE   (1L << 6)

◆ MWM_DECOR_MENU

#define MWM_DECOR_MENU   (1L << 4)

◆ MWM_DECOR_MINIMIZE

#define MWM_DECOR_MINIMIZE   (1L << 5)

◆ MWM_DECOR_RESIZEH

#define MWM_DECOR_RESIZEH   (1L << 2)

◆ MWM_DECOR_TITLE

#define MWM_DECOR_TITLE   (1L << 3)

◆ MWM_FUNC_ALL

#define MWM_FUNC_ALL   (1L << 0)

◆ MWM_FUNC_CLOSE

#define MWM_FUNC_CLOSE   (1L << 5)

◆ MWM_FUNC_MAXIMIZE

#define MWM_FUNC_MAXIMIZE   (1L << 4)

◆ MWM_FUNC_MINIMIZE

#define MWM_FUNC_MINIMIZE   (1L << 3)

◆ MWM_FUNC_MOVE

#define MWM_FUNC_MOVE   (1L << 2)

◆ MWM_FUNC_RESIZE

#define MWM_FUNC_RESIZE   (1L << 1)

◆ MWM_HINTS_DECORATIONS

#define MWM_HINTS_DECORATIONS   (1L << 1)

◆ MWM_HINTS_FUNCTIONS

#define MWM_HINTS_FUNCTIONS   (1L << 0)

◆ MWM_HINTS_INPUT_MODE

#define MWM_HINTS_INPUT_MODE   (1L << 2)

◆ MWM_HINTS_STATUS

#define MWM_HINTS_STATUS   (1L << 3)

◆ PROP_MOTIF_WM_HINTS_ELEMENTS

#define PROP_MOTIF_WM_HINTS_ELEMENTS   5

◆ TAG

#define TAG   CLIENT_TAG("x11")

FreeRDP: A Remote Desktop Protocol Implementation X11 Windows

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2012 HP Development Company, LLC Copyright 2016 Thincast Technologies GmbH Copyright 2016 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ xf_icon_prop

#define xf_icon_prop   FreeRDP_Icon_256px_prop

Function Documentation

◆ get_shm_id()

static const char* get_shm_id ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_AppUpdateWindowFromSurface()

UINT xf_AppUpdateWindowFromSurface ( xfContext *  xfc,
gdiGfxSurface *  surface 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_AppWindowCreate()

BOOL xf_AppWindowCreate ( xfContext *  xfc,
xfAppWindow *  appWindow 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_AppWindowDestroyImage()

static void xf_AppWindowDestroyImage ( xfAppWindow *  appWindow)
static
Here is the caller graph for this function:

◆ xf_AppWindowFromX11Window()

xfAppWindow* xf_AppWindowFromX11Window ( xfContext *  xfc,
Window  wnd 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_AppWindowInit()

int xf_AppWindowInit ( xfContext *  xfc,
xfAppWindow *  appWindow 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_AppWindowResize()

BOOL xf_AppWindowResize ( xfContext *  xfc,
xfAppWindow *  appWindow 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_CreateDesktopWindow()

xfWindow* xf_CreateDesktopWindow ( xfContext *  xfc,
char *  name,
int  width,
int  height 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_CreateDummyWindow()

Window xf_CreateDummyWindow ( xfContext *  xfc)
Here is the caller graph for this function:

◆ xf_DestroyDesktopWindow()

void xf_DestroyDesktopWindow ( xfContext *  xfc,
xfWindow *  window 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_DestroyDummyWindow()

void xf_DestroyDummyWindow ( xfContext *  xfc,
Window  window 
)
Here is the caller graph for this function:

◆ xf_DestroyWindow()

void xf_DestroyWindow ( xfContext *  xfc,
xfAppWindow *  appWindow 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_EndLocalMoveSize()

void xf_EndLocalMoveSize ( xfContext *  xfc,
xfAppWindow *  appWindow 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_FixWindowCoordinates()

static void xf_FixWindowCoordinates ( xfContext *  xfc,
int *  x,
int *  y,
int *  width,
int *  height 
)
static
Here is the caller graph for this function:

◆ xf_GetCurrentDesktop()

BOOL xf_GetCurrentDesktop ( xfContext *  xfc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_GetWindowProperty()

BOOL xf_GetWindowProperty ( xfContext *  xfc,
Window  window,
Atom  property,
int  length,
unsigned long *  nitems,
unsigned long *  bytes,
BYTE **  prop 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_GetWorkArea()

BOOL xf_GetWorkArea ( xfContext *  xfc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_MoveWindow()

void xf_MoveWindow ( xfContext *  xfc,
xfAppWindow *  appWindow,
int  x,
int  y,
int  width,
int  height 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_ResizeDesktopWindow()

void xf_ResizeDesktopWindow ( xfContext *  xfc,
xfWindow *  window,
int  width,
int  height 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_SendClientEvent()

void xf_SendClientEvent ( xfContext *  xfc,
Window  window,
Atom  atom,
unsigned int  numArgs,
  ... 
)

Post an event from the client to the X server

Here is the caller graph for this function:

◆ xf_SetWindowDecorations()

void xf_SetWindowDecorations ( xfContext *  xfc,
Window  window,
BOOL  show 
)
Here is the caller graph for this function:

◆ xf_SetWindowFullscreen()

void xf_SetWindowFullscreen ( xfContext *  xfc,
xfWindow *  window,
BOOL  fullscreen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_SetWindowMinimized()

void xf_SetWindowMinimized ( xfContext *  xfc,
xfWindow *  window 
)
Here is the caller graph for this function:

◆ xf_SetWindowMinMaxInfo()

void xf_SetWindowMinMaxInfo ( xfContext *  xfc,
xfAppWindow *  appWindow,
int  maxWidth,
int  maxHeight,
int  maxPosX,
int  maxPosY,
int  minTrackWidth,
int  minTrackHeight,
int  maxTrackWidth,
int  maxTrackHeight 
)
Here is the caller graph for this function:

◆ xf_SetWindowPID()

static void xf_SetWindowPID ( xfContext *  xfc,
Window  window,
pid_t  pid 
)
static
Here is the caller graph for this function:

◆ xf_SetWindowRects()

void xf_SetWindowRects ( xfContext *  xfc,
xfAppWindow *  appWindow,
RECTANGLE_16 rects,
int  nrects 
)
Here is the call graph for this function:

◆ xf_SetWindowStyle()

void xf_SetWindowStyle ( xfContext *  xfc,
xfAppWindow *  appWindow,
UINT32  style,
UINT32  ex_style 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_SetWindowText()

void xf_SetWindowText ( xfContext *  xfc,
xfAppWindow *  appWindow,
const char *  name 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_SetWindowTitleText()

static void xf_SetWindowTitleText ( xfContext *  xfc,
Window  window,
const char *  name 
)
static
Here is the caller graph for this function:

◆ xf_SetWindowUnlisted()

void xf_SetWindowUnlisted ( xfContext *  xfc,
Window  window 
)
Here is the caller graph for this function:

◆ xf_SetWindowVisibilityRects()

void xf_SetWindowVisibilityRects ( xfContext *  xfc,
xfAppWindow *  appWindow,
UINT32  rectsOffsetX,
UINT32  rectsOffsetY,
RECTANGLE_16 rects,
int  nrects 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_ShowWindow()

void xf_ShowWindow ( xfContext *  xfc,
xfAppWindow *  appWindow,
BYTE  state 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_StartLocalMoveSize()

void xf_StartLocalMoveSize ( xfContext *  xfc,
xfAppWindow *  appWindow,
int  direction,
int  x,
int  y 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xf_UpdateWindowArea()

void xf_UpdateWindowArea ( xfContext *  xfc,
xfAppWindow *  appWindow,
int  x,
int  y,
int  width,
int  height 
)
Here is the call graph for this function:
Here is the caller graph for this function: