FreeRDP/client/X11/xf_window.h

123 lines
4.3 KiB
C
Raw Normal View History

2011-08-09 06:24:12 +04:00
/**
2012-10-09 07:02:04 +04:00
* FreeRDP: A Remote Desktop Protocol Implementation
2011-08-09 06:24:12 +04:00
* X11 Windows
*
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* 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.
*/
#ifndef __XF_WINDOW_H
#define __XF_WINDOW_H
#include <X11/Xlib.h>
2011-08-09 06:24:12 +04:00
#include <freerdp/freerdp.h>
typedef struct xf_localmove xfLocalMove;
2011-08-09 06:24:12 +04:00
typedef struct xf_window xfWindow;
#include "xf_client.h"
#include "xfreerdp.h"
2011-08-09 06:24:12 +04:00
// Extended ICCM flags http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */
enum xf_localmove_state
{
LMS_NOT_ACTIVE,
LMS_STARTING,
LMS_ACTIVE,
LMS_TERMINATING
};
struct xf_localmove
{
int root_x; // relative to root
int root_y;
int window_x; // relative to window
int window_y;
enum xf_localmove_state state;
Multiple RAIL fixes/improvements 1. Linked Window Manager Maximize/Minimize and Restore operations to those from the Server Rail Window so that they are in sync 2. Enable things like "CTRL-ALT-DELETE" and "WindowsKey-L" to show the full desktop window again since the desktop is not actively monitored since this was still trying to draw to the rail window without updating the size of the window to accomodate the full workspace area. 3. Changed local window coordinates to be based on the visibileOffsetX/Y- while moving server window based on WindowOffsetX/Y. I have seen various issues regarding this when trying to use a maximized window where this is a disconnect between local window coordinates and remote window coordinates. This change clears these things up. 4. Commented the XShapeCombineRectangles calls - this can cause issues where the entire window is not visible and it does not currently play well with the changes from #3. The gain here is greater than the loss. 5. Draw the initial workspace correctly when running across multiple monitors. The correct size was always used, but the window was only starting on the current monitor and thus could draw the window off of the viewable area. Known Issues: Although the changes for #2 worked well in the stable branch that I developed from - the desktop window shown once the rail windows are destroyed does not respond to input unless I minimize/restore the window. Once the window starts responding to input - you can hit cancel to close the desktop window and return to your rail windows again(or launch task manager, etc.). This is still a big step in the right direction as xfreerdp is now correctly acting when the rail server stops Actively Monitoring the desktop. XShapeCombineRectangles needs to be revisited, most windows applications will give you a rectangular window anyways.
2012-08-04 02:35:17 +04:00
int direction;
};
2011-08-09 06:24:12 +04:00
struct xf_window
{
GC gc;
int left;
int top;
int right;
int bottom;
2011-08-09 06:24:12 +04:00
int width;
int height;
int shmid;
2011-08-09 06:24:12 +04:00
Window handle;
Window *xfwin;
BOOL fullscreen;
BOOL decorations;
rdpWindow *window;
BOOL is_mapped;
BOOL is_transient;
xfLocalMove local_move;
BYTE rail_state;
BOOL rail_ignore_configure;
2011-08-09 06:24:12 +04:00
};
void xf_ewmhints_init(xfContext *xfc);
BOOL xf_GetCurrentDesktop(xfContext *xfc);
BOOL xf_GetWorkArea(xfContext *xfc);
void xf_SetWindowFullscreen(xfContext *xfc, xfWindow *window, BOOL fullscreen);
void xf_SetWindowDecorations(xfContext *xfc, xfWindow *window, BOOL show);
void xf_SetWindowUnlisted(xfContext *xfc, xfWindow *window);
xfWindow *xf_CreateDesktopWindow(xfContext *xfc, char *name, int width, int height, BOOL decorations);
void xf_ResizeDesktopWindow(xfContext *xfc, xfWindow *window, int width, int height);
xfWindow *xf_CreateWindow(xfContext *xfc, rdpWindow *wnd, int x, int y, int width, int height, UINT32 id);
void xf_SetWindowText(xfContext *xfc, xfWindow *window, char *name);
void xf_MoveWindow(xfContext *xfc, xfWindow *window, int x, int y, int width, int height);
void xf_ShowWindow(xfContext *xfc, xfWindow *window, BYTE state);
void xf_SetWindowIcon(xfContext *xfc, xfWindow *window, rdpIcon *icon);
void xf_SetWindowRects(xfContext *xfc, xfWindow *window, RECTANGLE_16 *rects, int nrects);
void xf_SetWindowVisibilityRects(xfContext *xfc, xfWindow *window, RECTANGLE_16 *rects, int nrects);
void xf_SetWindowStyle(xfContext *xfc, xfWindow *window, UINT32 style, UINT32 ex_style);
void xf_UpdateWindowArea(xfContext *xfc, xfWindow *window, int x, int y, int width, int height);
BOOL xf_IsWindowBorder(xfContext *xfc, xfWindow *xfw, int x, int y);
void xf_DestroyWindow(xfContext *xfc, xfWindow *window);
rdpWindow *xf_rdpWindowFromWindow(xfContext *xfc, Window wnd);
BOOL xf_GetWindowProperty(xfContext *xfc, Window window, Atom property, int length,
unsigned long *nitems, unsigned long *bytes, BYTE **prop);
2012-08-14 23:59:11 +04:00
void xf_SetWindowMinMaxInfo(xfContext *xfc, xfWindow *window, int maxWidth, int maxHeight,
int maxPosX, int maxPosY, int minTrackWidth, int minTrackHeight, int maxTrackWidth, int maxTrackHeight);
void xf_StartLocalMoveSize(xfContext *xfc, xfWindow *window, int direction, int x, int y);
void xf_EndLocalMoveSize(xfContext *xfc, xfWindow *window);
void xf_SendClientEvent(xfContext *xfc, xfWindow *window, Atom atom, unsigned int numArgs, ...);
2011-08-09 06:24:12 +04:00
#endif /* __XF_WINDOW_H */