blob: ce1a91a25ff49dd8c5328a53451202b471f95bf1 [file] [log] [blame]
/*
* Focus functions
*
* Copyright 1993 David Metcalfe
*/
static char Copyright[] = "Copyright David Metcalfe, 1993";
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include "win.h"
#include "gdi.h"
HWND hWndFocus = 0;
/*****************************************************************
* SetFocus (USER.22)
*/
HWND SetFocus(HWND hwnd)
{
HWND hWndPrevFocus;
WND *wndPtr;
hWndPrevFocus = hWndFocus;
if (hwnd == 0)
{
XSetInputFocus(XT_display, None, RevertToPointerRoot, CurrentTime);
}
else
{
wndPtr = WIN_FindWndPtr(hwnd);
XSetInputFocus(XT_display, XtWindow(wndPtr->winWidget),
RevertToParent, CurrentTime);
}
return hWndPrevFocus;
}
/*****************************************************************
* GetFocus (USER.23)
*/
HWND GetFocus(void)
{
return hWndFocus;
}