16#include "functions_defs.h"
82 if(action && ! strncmp(action,
"WGOTO : ", 8)) {
84 ((
char *)action) + 8);
90 while(item && item->
sub) {
102 w, tmp_win, eventp, context, pulldown);
118 XWindowAttributes attr;
128 menu->
width -= 16 + 10;
142 XMoveWindow(
dpy, menu->
w, menu->
x, menu->
y);
143 XMapRaised(
dpy, menu->
w);
161 stat_ = sscanf(action,
"%d", &alt);
165 if((alt < 1) || (alt > 5)) {
169 XGrabPointer(
dpy,
Scr->Root, True, ButtonPressMask | ButtonReleaseMask,
170 GrabModeAsync, GrabModeAsync,
171 Scr->Root,
Scr->AlterCursor, CurrentTime);
173 XGrabKeyboard(
dpy,
Scr->Root, True, GrabModeAsync, GrabModeAsync, CurrentTime);
180 XGrabPointer(
dpy,
Scr->Root, False, ButtonPressMask | ButtonReleaseMask,
181 GrabModeAsync, GrabModeAsync,
182 Scr->Root,
Scr->AlterCursor, CurrentTime);
184 XGrabKeyboard(
dpy,
Scr->Root, False, GrabModeAsync, GrabModeAsync, CurrentTime);
221 if(!tmp_win->iswinbox) {
242 for(
TwmWindow *t =
Scr->FirstWindow; t != NULL; t = t->next) {
243 if(t->icon && t->icon->w) {
266 unsigned int dummask;
284 fprintf(stderr,
"%s: unable to warp to unmanaged screen %d\n",
291 if(
Scr->screen == n) {
296 XQueryPointer(
dpy,
Scr->Root, &dumwin, &dumwin, &
x, &
y,
297 &dumint, &dumint, &dummask);
299 XWarpPointer(
dpy, None, newscr->
Root, 0, 0, 0, 0,
x,
y);
342static void Execute(
const char *_s);
347 if(!
Scr->NoGrabServer) {
351 XUngrabPointer(
dpy, CurrentTime);
378 orig_display = getenv(
"DISPLAY");
393 _ds = DisplayString(
dpy);
404 colon = strrchr(ds,
':');
406 char *dot, *new_display;
409 dot = strchr(colon,
'.');
415 asprintf(&new_display,
"%s.%d", ds,
Scr->screen);
422 setenv(
"DISPLAY", new_display, 1);
434 subs = strstr(s,
"$currentworkspace");
453 subs = strstr(s,
"$redirect");
458 if(
CLarg.is_captive) {
459 asprintf(&redir,
"-xrm 'ctwm.redirect:%s'",
Scr->captivename);
496 setenv(
"DISPLAY", orig_display, 1);
void StartAnimation(void)
void ModifyAnimationSpeed(int incr)
int NumScreens
How many Screens are on our display.
ScreenInfo ** ScreenList
List of ScreenInfo structs for each Screen.
void DoShutdown(void)
Cleanup and exit ctwm.
void DoRestart(Time t)
exec() ourself to restart.
void ExecuteFunction(int func, void *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, bool pulldown)
static void WarpToScreen(int n, int inc)
static void Execute(const char *_s)
Window Root
Root window for the current vscreen.
void OtpRaise(TwmWindow *twm_win, WinType wintype)
char * replace_substr(const char *str, const char *old, const char *new)
Info and control for each X Screen we control.
Info and control for every X Window we take over.
void RescueWindows(void)
Backend for f.rescuewindows.
void DebugTrace(char *file)
Backend for f.trace.
void fittocontent(TwmWindow *twmwin)
void GotoWorkSpaceByName(VirtualScreen *vs, const char *wname)
void ShowBackground(VirtualScreen *vs, int newstate)
char * GetCurrentWorkSpaceName(VirtualScreen *vs)