2
* Functions related to the warp ring
4
* There are functions that are _named_ like warp-ring funcs, but aren't
5
* really, and so aren't here. Some examples are f.warphere which is
6
* workspaces-related, and f.warptoscreen which is screen-related.
8
* There are also funcs that aren't really ring related, but I've put
9
* here because they're still warping to window related, like f.warpto /
17
#include "functions_internal.h"
23
#include "win_iconify.h"
33
#ifdef WARPTO_FROM_ICONMGR
34
/* XXX should be iconmgrp? */
35
if(len == 0 && tmp_win && tmp_win->iconmgr) {
36
printf("curren iconmgr entry: %s", tmp_win->iconmgr->Current);
38
#endif /* #ifdef WARPTO_FROM_ICONMGR */
39
for(tw = Scr->FirstWindow; tw != NULL; tw = tw->next) {
40
if(!strncmp(action, tw->full_name, len)) {
43
if(match(action, tw->full_name)) {
48
for(tw = Scr->FirstWindow; tw != NULL; tw = tw->next) {
49
if(!strncmp(action, tw->class.res_name, len)) {
52
if(match(action, tw->class.res_name)) {
57
for(tw = Scr->FirstWindow; tw != NULL; tw = tw->next) {
58
if(!strncmp(action, tw->class.res_class, len)) {
61
if(match(action, tw->class.res_class)) {
69
if(Scr->WarpUnmapped || tw->mapped) {
73
WarpToWindow(tw, Scr->RaiseOnWarp);
82
DFHANDLER(warptoiconmgr)
84
TwmWindow *tw, *raisewin = NULL;
86
Window iconwin = None;
90
if(tmp_win && tmp_win->iconmanagerlist) {
91
raisewin = tmp_win->iconmanagerlist->iconmgr->twm_win;
92
iconwin = tmp_win->iconmanagerlist->icon;
94
else if(Scr->iconmgr->active) {
95
raisewin = Scr->iconmgr->twm_win;
96
iconwin = Scr->iconmgr->active->w;
100
for(tw = Scr->FirstWindow; tw != NULL; tw = tw->next) {
101
if(strncmp(action, tw->icon_name, len) == 0) {
102
if(tw->iconmanagerlist &&
103
tw->iconmanagerlist->iconmgr->twm_win->mapped) {
104
raisewin = tw->iconmanagerlist->iconmgr->twm_win;
112
OtpRaise(raisewin, WinWin);
113
XWarpPointer(dpy, None, iconwin, 0, 0, 0, 0, 5, 5);
121
/* Taken from vtwm version 5.3 */
124
if(tmp_win->ring.next || tmp_win->ring.prev) {
125
/* It's in the ring, let's take it out. */
126
TwmWindow *prev = tmp_win->ring.prev, *next = tmp_win->ring.next;
130
* 2. If window was only thing in ring, null out ring
131
* 3. If window was ring leader, set to next (or null)
134
prev->ring.next = next;
137
next->ring.prev = prev;
139
if(Scr->Ring == tmp_win) {
140
Scr->Ring = (next != tmp_win ? next : NULL);
143
if(!Scr->Ring || Scr->RingLeader == tmp_win) {
144
Scr->RingLeader = Scr->Ring;
146
tmp_win->ring.next = tmp_win->ring.prev = NULL;
149
/* Not in the ring, so put it in. */
151
tmp_win->ring.next = Scr->Ring->ring.next;
152
if(Scr->Ring->ring.next->ring.prev) {
153
Scr->Ring->ring.next->ring.prev = tmp_win;
155
Scr->Ring->ring.next = tmp_win;
156
tmp_win->ring.prev = Scr->Ring;
159
tmp_win->ring.next = tmp_win->ring.prev = Scr->Ring = tmp_win;
162
/*tmp_win->ring.cursor_valid = false;*/
168
switch(((char *)action)[0]) {
170
WarpAlongRing(&eventp->xbutton, true);
173
WarpAlongRing(&eventp->xbutton, false);
183
* Synthetic function: this is used internally as the action in some
184
* magic menus like the TwmWindows et al.
188
tmp_win = (TwmWindow *)action;
193
if(Scr->WarpUnmapped || tmp_win->mapped) {
194
if(!tmp_win->mapped) {
197
WarpToWindow(tmp_win, Scr->RaiseOnWarp);