View | Details | Raw Unified | Return to bug 47533
Collapse All | Expand All

(-)a/client/X11/xf_client.c (+11 lines)
Lines 1998-2003 static BOOL xfreerdp_client_new(freerdp* instance, rdpContext* context) Link Here
1998
	xfc->WM_STATE = XInternAtom(xfc->display, "WM_STATE", False);
1998
	xfc->WM_STATE = XInternAtom(xfc->display, "WM_STATE", False);
1999
	xfc->x11event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds, WINPR_FD_READ);
1999
	xfc->x11event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds, WINPR_FD_READ);
2000
2000
2001
	xfc->_NET_WM_ALLOWED_ACTIONS = XInternAtom(xfc->display, "_NET_WM_ALLOWED_ACTIONS", False);
2002
2003
	xfc->_NET_WM_ACTION_CLOSE = XInternAtom(xfc->display, "_NET_WM_ACTION_CLOSE", False);
2004
	xfc->_NET_WM_ACTION_MINIMIZE = XInternAtom(xfc->display, "_NET_WM_ACTION_MINIMIZE", False);
2005
	xfc->_NET_WM_ACTION_MOVE = XInternAtom(xfc->display, "_NET_WM_ACTION_MOVE", False);
2006
	xfc->_NET_WM_ACTION_RESIZE = XInternAtom(xfc->display, "_NET_WM_ACTION_RESIZE", False);
2007
	xfc->_NET_WM_ACTION_MAXIMIZE_HORZ = XInternAtom(xfc->display, "_NET_WM_ACTION_MAXIMIZE_HORZ", False);
2008
	xfc->_NET_WM_ACTION_MAXIMIZE_VERT = XInternAtom(xfc->display, "_NET_WM_ACTION_MAXIMIZE_VERT", False);
2009
	xfc->_NET_WM_ACTION_FULLSCREEN = XInternAtom(xfc->display, "_NET_WM_ACTION_FULLSCREEN", False);
2010
	xfc->_NET_WM_ACTION_CHANGE_DESKTOP = XInternAtom(xfc->display, "_NET_WM_ACTION_CHANGE_DESKTOP", False);
2011
2001
	if (!xfc->x11event)
2012
	if (!xfc->x11event)
2002
	{
2013
	{
2003
		WLog_ERR(TAG, "Could not create xfds event");
2014
		WLog_ERR(TAG, "Could not create xfds event");
(-)a/client/X11/xf_rail.c (-2 / +6 lines)
Lines 97-104 void xf_rail_send_activate(xfContext* xfc, Window xwindow, BOOL enabled) Link Here
97
97
98
	if (enabled)
98
	if (enabled)
99
		xf_SetWindowStyle(xfc, appWindow, appWindow->dwStyle, appWindow->dwExStyle);
99
		xf_SetWindowStyle(xfc, appWindow, appWindow->dwStyle, appWindow->dwExStyle);
100
	else
101
		xf_SetWindowStyle(xfc, appWindow, 0, 0);
102
100
103
	activate.windowId = appWindow->windowId;
101
	activate.windowId = appWindow->windowId;
104
	activate.enabled = enabled;
102
	activate.enabled = enabled;
Lines 518-523 static BOOL xf_rail_window_common(rdpContext* context, const WINDOW_ORDER_INFO* Link Here
518
			                            visibilityRectsOffsetY, appWindow->visibilityRects,
516
			                            visibilityRectsOffsetY, appWindow->visibilityRects,
519
			                            appWindow->numVisibilityRects);
517
			                            appWindow->numVisibilityRects);
520
		}
518
		}
519
520
		if (appWindow->rail_state == WINDOW_SHOW_MAXIMIZED)
521
		{
522
			xf_SendClientEvent(xfc, appWindow->handle, xfc->_NET_WM_STATE, 4, _NET_WM_STATE_ADD,
523
			   xfc->_NET_WM_STATE_MAXIMIZED_VERT, xfc->_NET_WM_STATE_MAXIMIZED_HORZ, 0, 0);
524
		}
521
	}
525
	}
522
526
523
	/* We should only be using the visibility rects for shaping the window */
527
	/* We should only be using the visibility rects for shaping the window */
(-)a/client/X11/xf_window.c (-6 / +49 lines)
Lines 654-659 void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, UIN Link Here
654
	Atom window_type;
654
	Atom window_type;
655
	BOOL redirect = FALSE;
655
	BOOL redirect = FALSE;
656
656
657
	window_type = xfc->_NET_WM_WINDOW_TYPE_NORMAL;
658
657
	if ((ex_style & WS_EX_NOACTIVATE) || (ex_style & WS_EX_TOOLWINDOW))
659
	if ((ex_style & WS_EX_NOACTIVATE) || (ex_style & WS_EX_TOOLWINDOW))
658
	{
660
	{
659
		redirect = TRUE;
661
		redirect = TRUE;
Lines 669-684 void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, UIN Link Here
669
	{
671
	{
670
		window_type = xfc->_NET_WM_WINDOW_TYPE_NORMAL;
672
		window_type = xfc->_NET_WM_WINDOW_TYPE_NORMAL;
671
	}
673
	}
672
	else if (style & WS_POPUP)
674
675
	if (style & WS_POPUP)
673
	{
676
	{
674
		/* this includes dialogs, popups, etc, that need to be full-fledged windows */
675
		appWindow->is_transient = TRUE;
676
		window_type = xfc->_NET_WM_WINDOW_TYPE_DIALOG;
677
		window_type = xfc->_NET_WM_WINDOW_TYPE_DIALOG;
677
		xf_SetWindowUnlisted(xfc, appWindow->handle);
678
		/* this includes dialogs, popups, etc, that need to be full-fledged windows */
679
680
		if (!((ex_style & WS_EX_DLGMODALFRAME) || (ex_style & WS_EX_LAYERED) || (style & WS_SYSMENU)))
681
		{
682
			appWindow->is_transient = TRUE;
683
			redirect = TRUE;
684
685
			xf_SetWindowUnlisted(xfc, appWindow->handle);
686
		}
678
	}
687
	}
679
	else
688
689
	if (!(style == 0 && ex_style == 0))
680
	{
690
	{
681
		window_type = xfc->_NET_WM_WINDOW_TYPE_NORMAL;
691
		xf_SetWindowActions(xfc, appWindow);
682
	}
692
	}
683
693
684
	{
694
	{
Lines 700-705 void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, UIN Link Here
700
	                PropModeReplace, (BYTE*)&window_type, 1);
710
	                PropModeReplace, (BYTE*)&window_type, 1);
701
}
711
}
702
712
713
void xf_SetWindowActions(xfContext* xfc, xfAppWindow* appWindow)
714
{
715
	Atom allowed_actions[] = {
716
		xfc->_NET_WM_ACTION_CLOSE,
717
		xfc->_NET_WM_ACTION_MINIMIZE,
718
		xfc->_NET_WM_ACTION_MOVE,
719
		xfc->_NET_WM_ACTION_RESIZE,
720
		xfc->_NET_WM_ACTION_MAXIMIZE_HORZ,
721
		xfc->_NET_WM_ACTION_MAXIMIZE_VERT,
722
		xfc->_NET_WM_ACTION_FULLSCREEN,
723
		xfc->_NET_WM_ACTION_CHANGE_DESKTOP
724
	};
725
726
	if (!(appWindow->dwStyle & WS_SYSMENU))
727
		allowed_actions[0] = 0;
728
729
	if (!(appWindow->dwStyle & WS_MINIMIZEBOX))
730
		allowed_actions[1] = 0;
731
732
	if (!(appWindow->dwStyle & WS_SIZEBOX))
733
		allowed_actions[3] = 0;
734
735
	if (!(appWindow->dwStyle & WS_MAXIMIZEBOX))
736
	{
737
		allowed_actions[4] = 0;
738
		allowed_actions[5] = 0;
739
		allowed_actions[6] = 0;
740
	}
741
742
	XChangeProperty(xfc->display, appWindow->handle, xfc->_NET_WM_ALLOWED_ACTIONS, XA_ATOM, 32,
743
		PropModeReplace, (unsigned char *) &allowed_actions, 8);
744
}
745
703
void xf_SetWindowText(xfContext* xfc, xfAppWindow* appWindow, const char* name)
746
void xf_SetWindowText(xfContext* xfc, xfAppWindow* appWindow, const char* name)
704
{
747
{
705
	xf_SetWindowTitleText(xfc, appWindow->handle, name);
748
	xf_SetWindowTitleText(xfc, appWindow->handle, name);
(-)a/client/X11/xf_window.h (+1 lines)
Lines 179-184 void xf_SetWindowRects(xfContext* xfc, xfAppWindow* appWindow, RECTANGLE_16* rec Link Here
179
void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, UINT32 rectsOffsetX,
179
void xf_SetWindowVisibilityRects(xfContext* xfc, xfAppWindow* appWindow, UINT32 rectsOffsetX,
180
                                 UINT32 rectsOffsetY, RECTANGLE_16* rects, int nrects);
180
                                 UINT32 rectsOffsetY, RECTANGLE_16* rects, int nrects);
181
void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, UINT32 ex_style);
181
void xf_SetWindowStyle(xfContext* xfc, xfAppWindow* appWindow, UINT32 style, UINT32 ex_style);
182
void xf_SetWindowActions(xfContext* xfc, xfAppWindow* appWindow);
182
void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int width,
183
void xf_UpdateWindowArea(xfContext* xfc, xfAppWindow* appWindow, int x, int y, int width,
183
                         int height);
184
                         int height);
184
void xf_DestroyWindow(xfContext* xfc, xfAppWindow* appWindow);
185
void xf_DestroyWindow(xfContext* xfc, xfAppWindow* appWindow);
(-)a/client/X11/xfreerdp.h (+12 lines)
Lines 245-250 struct xf_context Link Here
245
	Atom WM_PROTOCOLS;
245
	Atom WM_PROTOCOLS;
246
	Atom WM_DELETE_WINDOW;
246
	Atom WM_DELETE_WINDOW;
247
247
248
	/* Allow actions */
249
	Atom _NET_WM_ALLOWED_ACTIONS;
250
251
	Atom _NET_WM_ACTION_CLOSE;
252
	Atom _NET_WM_ACTION_MINIMIZE;
253
	Atom _NET_WM_ACTION_MOVE;
254
	Atom _NET_WM_ACTION_RESIZE;
255
	Atom _NET_WM_ACTION_MAXIMIZE_HORZ;
256
	Atom _NET_WM_ACTION_MAXIMIZE_VERT;
257
	Atom _NET_WM_ACTION_FULLSCREEN;
258
	Atom _NET_WM_ACTION_CHANGE_DESKTOP;
259
248
	/* Channels */
260
	/* Channels */
249
#if defined(CHANNEL_TSMF_CLIENT)
261
#if defined(CHANNEL_TSMF_CLIENT)
250
	TsmfClientContext* tsmf;
262
	TsmfClientContext* tsmf;

Return to bug 47533