CTWM
Loading...
Searching...
No Matches
/usr/src/RPM/BUILD/ctwm-4.1.0/functions_captive.c
Go to the documentation of this file.
1/*
2 * Functions related to captive-mode ctwm.
3 */
4
5#include "ctwm.h"
6
7#include <stdlib.h>
8
9#include "captive.h"
10#include "cursor.h"
11#include "events.h"
12#include "functions_internal.h"
13#include "screen.h"
14
15
16/*
17 * Pulling a window into the ctwm it was invoked from.
18 */
23
24
25/*
26 * Interactively moving a window between ctwm's.
27 */
29{
30 bool cont = true;
31 Window root = RootWindow(dpy, Scr->screen);
32 Cursor cursor;
34
35 if(tmp_win->iswinbox || tmp_win->iswspmgr) {
36 XBell(dpy, 0);
37 return;
38 }
39
40 {
42 cursor = MakeStringCursor(cctwm.name);
43 free(cctwm.name);
44 captive_root = cctwm.root;
45 }
46
50 while(cont) {
53 switch(Event.xany.type) {
54 case ButtonPress:
55 cont = false;
56 break;
57
58 case ButtonRelease: {
60 cont = false;
61 free(cctwm.name);
62 if(cctwm.root == Scr->Root) {
63 break;
64 }
65 if(cctwm.root == Scr->XineramaRoot) {
66 break;
67 }
70 XReparentWindow(dpy, tmp_win->w, cctwm.root, 0, 0);
72 break;
73 }
74
75 case MotionNotify: {
77 if(cctwm.root != captive_root) {
78 unsigned int chmask;
79
80 XFreeCursor(dpy, cursor);
81 cursor = MakeStringCursor(cctwm.name);
82 captive_root = cctwm.root;
83
87 cursor, CurrentTime);
88 }
89 free(cctwm.name);
90 break;
91 }
92 }
93 }
94
95 ButtonPressed = -1;
97 XFreeCursor(dpy, cursor);
98
99 return;
100}
static int PlaceX
Definition add_window.c:82
void SetNoRedirect(Window window)
Definition captive.c:609
void AdoptWindow(void)
Definition captive.c:690
CaptiveCTWM GetCaptiveCTWMUnderPointer(void)
Definition captive.c:550
Display * dpy
Definition ctwm_main.c:84
#define Scr
Cursor MakeStringCursor(char *string)
Definition cursor.c:184
XEvent Event
Definition event_core.c:66
int ButtonPressed
Definition event_core.c:93
#define DFHANDLER(func)
MenuRoot * root
Definition parse_yacc.c:26
int cont
Definition parse_yacc.c:28