CTWM
|
#include "ctwm.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <X11/Xatom.h>
#include "otp.h"
#include "ctwm_atoms.h"
#include "screen.h"
#include "util.h"
#include "icons.h"
#include "list.h"
#include "events.h"
#include "event_handlers.h"
#include "vscreen.h"
#include "win_utils.h"
Go to the source code of this file.
Data Structures | |
struct | OtpWinList |
struct | OtpPreferences |
struct | Box |
Macros | |
#define | DEBUG_OTP 0 |
#define | DPRINTF(x) |
#define | CHECK_OTP 1 |
#define | OTP_ZERO 8 |
#define | OTP_MAX (OTP_ZERO * 2) |
#define | PRI(owl) OwlEffectivePriority(owl) |
#define | PRI_CP(from, to) |
Typedefs | |
typedef struct Box | Box |
Definition at line 36 of file otp.c.
Referenced by InsertOwl(), InsertOwlAbove(), OtpCheckConsistencyVS(), OtpCirculateSubwindows(), OtpHandleCirculateNotify(), OtpSetPriority(), ReparentWindow(), ReparentWindowAndIcon(), and SetOwlPriority().
Definition at line 47 of file otp.c.
Referenced by ApplyPreferences(), free_OtpPreferences(), new_OtpPreferences(), OtpCheckConsistencyVS(), OtpSwitchPriority(), OwlEffectivePriority(), RaiseLowerOwl(), SetOwlPriority(), and TryToSwitch().
#define OTP_ZERO 8 |
Definition at line 46 of file otp.c.
Referenced by AddNewOwl(), new_OtpPreferences(), OtpEffectiveDisplayPriority(), OtpScrPriorityL(), OtpScrSetZero(), OtpSetPriority(), OtpSwitchPriority(), and OwlEffectivePriority().
#define PRI | ( | owl | ) | OwlEffectivePriority(owl) |
Definition at line 50 of file otp.c.
Referenced by AddNewOwl(), InsertOwl(), InsertOwlAbove(), OtpCheckConsistencyVS(), OtpFocusWindow(), OtpUnfocusWindow(), OwlRightBelow(), RaiseLowerOwl(), TinyLowerOwl(), TinyRaiseOwl(), and TryToMoveTransientsOfTo().
Definition at line 51 of file otp.c.
Referenced by AddNewOwl(), InsertOwl(), and RaiseSmallTransientsOfAbove().
|
static |
Definition at line 1134 of file otp.c.
References ApplyPreferences(), EWMH_STATE_ABOVE, EWMH_STATE_BELOW, EWMH_STATE_FULLSCREEN, EwmhGetInitPriority(), IconWin, InsertOwl(), TwmWindow::istransient, new_OtpWinList(), OTP_ZERO, OwlGetStashedAflags(), OwlStashAflags(), PlaceX, PRI, PRI_CP, and Scr.
Referenced by OtpAdd().
|
static |
Definition at line 1024 of file otp.c.
References TwmWindow::class, LookInList(), TwmWindow::name, OTP_MAX, and PlaceX.
Referenced by AddNewOwl(), and RecomputeOwlPrefs().
|
static |
Definition at line 91 of file otp.c.
References TwmWindow::frame_height, TwmWindow::frame_width, TwmWindow::frame_x, TwmWindow::frame_y, IconWin, PlaceX, Icon::w_height, Icon::w_width, Icon::w_x, Icon::w_y, WinWin, and Icon::x.
Referenced by isIntersectingWith().
|
static |
Definition at line 1354 of file otp.c.
References FreeList(), OTP_MAX, and PlaceX.
Referenced by OtpScrInitData().
|
static |
|
static |
For the purpose of putting a window above another, they need to have the same parent, i.e.
be in the same VirtualScreen.
Definition at line 378 of file otp.c.
References OtpWinList::below, and PlaceX.
Referenced by InsertOwlAbove().
|
static |
Definition at line 561 of file otp.c.
References DPRINTF, InsertOwlAbove(), OwlRightBelow(), PlaceX, PRI, PRI_CP, RaiseSmallTransientsOfAbove(), Scr, and shouldStayAbove().
Referenced by AddNewOwl(), LowerOwl(), OtpFocusWindowBE(), OtpRestackWindow(), RaiseOwl(), RecomputeOwlPrefs(), and SetOwlPriority().
|
static |
Definition at line 415 of file otp.c.
References DPRINTF, dpy, GetOwlAtOrBelowInVS(), PlaceX, PRI, Scr, and WindowOfOwl().
Referenced by InsertOwl(), OtpForcePlacement(), RaiseSmallTransientsOfAbove(), ReparentWindow(), ReparentWindowAndIcon(), TinyLowerOwl(), and TinyRaiseOwl().
Definition at line 153 of file otp.c.
References TwmWindow::group, and TwmWindow::w.
Referenced by isGroupLeaderOf(), and OtpAdd().
Definition at line 159 of file otp.c.
References TwmWindow::group, isGroupLeader(), and PlaceX.
Referenced by OtpAdd().
|
static |
Definition at line 693 of file otp.c.
References isIntersectingWith(), isOnScreen(), and PlaceX.
Referenced by RaiseLowerOwl(), TinyLowerOwl(), and TinyRaiseOwl().
|
static |
Definition at line 130 of file otp.c.
References BoxesIntersect(), BoxOfOwl(), and PlaceX.
Referenced by isHiddenBy().
|
static |
Definition at line 139 of file otp.c.
References TwmWindow::iconified, IconWin, TwmWindow::mapped, OCCUPY, PlaceX, and Scr.
Referenced by isHiddenBy().
Definition at line 166 of file otp.c.
References isTransientOf(), main(), PlaceX, and Scr.
Referenced by shouldStayAbove().
Definition at line 148 of file otp.c.
References main(), and PlaceX.
Referenced by isSmallTransientOf(), OtpAdd(), OtpFocusWindowBE(), and TryToMoveTransientsOfTo().
|
static |
Definition at line 686 of file otp.c.
References InsertOwl(), PlaceX, RemoveOwl(), and TryToSwitch().
Referenced by OtpLower(), and RaiseLowerOwl().
|
static |
Definition at line 1222 of file otp.c.
References AddNewOwl(), TwmWindow::icon, IconWin, isGroupLeader(), isGroupLeaderOf(), TwmWindow::istransient, isTransientOf(), Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, Scr, OtpWinList::switching, and WinWin.
Referenced by AddWindow(), CreateIconWindow(), and OtpReassignIcon().
Definition at line 1437 of file otp.c.
References OtpWinList::above, PlaceX, Scr, OtpWinList::twm_win, and WinWin.
Referenced by EwmhSet_NET_CLIENT_LIST_STACKING(), GotoWorkSpace(), and RestoreForShutdown().
Definition at line 920 of file otp.c.
References TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, OtpWinList::pri_base, SetOwlPriority(), and TryToMoveTransientsOfTo().
Referenced by otp_priority_handler().
Definition at line 188 of file otp.c.
References OtpCheckConsistencyVS(), PlaceX, and Scr.
Referenced by DisplayWin(), GotoWorkSpace(), OtpAdd(), OtpChangePriority(), OtpFocusWindowBE(), OtpForcePlacement(), OtpLower(), OtpRaise(), OtpRaiseLower(), OtpRecomputePrefs(), OtpRemove(), OtpRestackWindow(), OtpSetPriority(), OtpSwitchPriority(), OtpTinyLower(), OtpTinyRaise(), OtpToggleSwitching(), ReparentWindow(), and ReparentWindowAndIcon().
|
static |
Definition at line 205 of file otp.c.
References DPRINTF, dpy, TwmWindow::icon, IconWin, TwmWindow::name, TwmWindow::next, TwmWindow::occupation, Icon::otp, TwmWindow::otp, OTP_MAX, OwlPrettyPrint(), TwmWindow::parent_vs, PlaceX, PRI, root, Scr, TwmWindow::vs, WindowOfOwl(), WinWin, VirtualScreen::x, and VirtualScreen::y.
Referenced by OtpCheckConsistency().
void OtpCirculateSubwindows | ( | VirtualScreen * | vs, |
int | direction ) |
Definition at line 849 of file otp.c.
References DPRINTF, dpy, Event, HandleCirculateNotify(), PlaceX, and VirtualScreen::window.
Referenced by f_circledown_impl(), and f_circleup_impl().
Definition at line 1559 of file otp.c.
References TwmWindow::otp, OwlClearAflag(), and PlaceX.
Referenced by unzoom().
Definition at line 1794 of file otp.c.
References TwmWindow::otp, OTP_ZERO, OwlEffectivePriority(), and PlaceX.
Referenced by EwmhSet_NET_WM_STATE(), Identify(), and OwlPrettyPrint().
Definition at line 1803 of file otp.c.
References TwmWindow::otp, OwlEffectivePriority(), and PlaceX.
Referenced by EwmhClientMessage_NET_WM_STATEchange(), and OwlPrettyPrint().
Focus a window.
This needs to know internals of OTP because of focus-dependent stacking of it and its transients.
Definition at line 1774 of file otp.c.
References TwmWindow::otp, OtpFocusWindowBE(), PlaceX, PRI, and Scr.
Referenced by HandleFocusIn(), and SetFocus().
Focus/unfocus backend.
This is used on windows whose stacking is focus-dependent (e.g., EWMH fullscreen), to move them and their transients around. For these windows, getting/losing focus is practically the same as a f.setpriority, except it's on the calculated rather than the base parts. And it's hard to re-use our existing functions to do it because we have to move Scr->Focus before the main window changes, but then it's too late to see where all the transients were.
There are a number of unpleasant assumptions in here relating to where the transients are, and IWBNI we could be smarter and quicker about dealing with them. But this gets us past the simple to cause assertion failures, anyway...
Definition at line 1675 of file otp.c.
References OtpWinList::above, InsertOwl(), isTransientOf(), TwmWindow::otp, OtpCheckConsistency(), PlaceX, RemoveOwl(), Scr, and WinWin.
Referenced by OtpFocusWindow(), and OtpUnfocusWindow().
Definition at line 990 of file otp.c.
References InsertOwlAbove(), TwmWindow::otp, OtpCheckConsistency(), PlaceX, and RemoveOwl().
Referenced by HandleConfigureRequest().
Definition at line 1278 of file otp.c.
References TwmWindow::icon, IconWin, OtpRemove(), and PlaceX.
Referenced by RedoIcon().
void OtpHandleCirculateNotify | ( | VirtualScreen * | vs, |
TwmWindow * | twm_win, | ||
WinType | wintype, | ||
int | place ) |
Definition at line 877 of file otp.c.
References DPRINTF, OtpLower(), OtpRaise(), and PlaceX.
Referenced by HandleCirculateNotify().
Definition at line 1883 of file otp.c.
References TwmWindow::otp, PlaceX, and OtpWinList::pri_aflags.
Referenced by HandleFocusIn(), HandleFocusOut(), and SetFocus().
Definition at line 777 of file otp.c.
References EwmhSet_NET_CLIENT_LIST_STACKING(), TwmWindow::icon, IconWin, LowerOwl(), Icon::otp, TwmWindow::otp, OtpCheckConsistency(), and PlaceX.
Referenced by AutoLowerWindow(), f_lower_impl(), HandleConfigureRequest(), and OtpHandleCirculateNotify().
Definition at line 1467 of file otp.c.
References OtpWinList::below, TwmWindow::otp, PlaceX, OtpWinList::twm_win, and WinWin.
Referenced by GotoWorkSpace().
Definition at line 1458 of file otp.c.
References OtpWinList::above, TwmWindow::otp, PlaceX, OtpWinList::twm_win, and WinWin.
Referenced by EwmhSet_NET_CLIENT_LIST_STACKING(), GotoWorkSpace(), and RestoreForShutdown().
Definition at line 763 of file otp.c.
References EwmhSet_NET_CLIENT_LIST_STACKING(), TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, and RaiseOwl().
Referenced by AutoRaiseWindow(), AutoSqueeze(), EndResize(), f_movetitlebar_impl(), f_popup_impl(), f_raiseicons_impl(), f_showiconmgr_impl(), f_showworkspacemgr_impl(), f_toggleworkspacemgr_impl(), f_warptoiconmgr_impl(), fullzoom(), HandleButtonPress(), HandleButtonRelease(), HandleConfigureRequest(), HandleEnterNotify(), HandleMapRequest(), Iconify(), jump(), JumpIconManager(), MoveIconManager(), MoveMappedIconManager(), MoveToNextWorkSpaceAndFollow(), MoveToPrevWorkSpaceAndFollow(), movewindow(), OtpHandleCirculateNotify(), packwindow(), raise_handler(), RedoIcon(), ReMapOne(), and WMgrHandleButtonEvent().
Definition at line 791 of file otp.c.
References EwmhSet_NET_CLIENT_LIST_STACKING(), TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, and RaiseLowerOwl().
Referenced by f_raiselower_impl(), and HandleConfigureRequest().
Definition at line 1262 of file otp.c.
References TwmWindow::icon, IconWin, Icon::otp, OtpAdd(), and PlaceX.
Referenced by RedoIcon().
Definition at line 1073 of file otp.c.
References TwmWindow::icon, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, RecomputeOwlPrefs(), and Scr.
Referenced by apply_window_name().
Definition at line 1094 of file otp.c.
References free_OtpWinList(), TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, and RemoveOwl().
Referenced by HandleDestroyNotify(), and OtpFreeIcon().
Definition at line 1648 of file otp.c.
References InsertOwl(), TwmWindow::otp, OtpCheckConsistency(), PlaceX, and RemoveOwl().
Referenced by EwmhClientMessage_NET_WM_STATEchange(), fullzoom(), and unzoom().
void OtpScrInitData | ( | ScreenInfo * | scr | ) |
Definition at line 1366 of file otp.c.
References free_OtpPreferences(), ScreenInfo::IconOTP, new_OtpPreferences(), ScreenInfo::OTP, and PlaceX.
Referenced by InitScreenInfo().
name_list ** OtpScrPriorityL | ( | ScreenInfo * | scr, |
WinType | wintype, | ||
int | priority ) |
Definition at line 1324 of file otp.c.
References ABS, ScreenInfo::IconOTP, IconWin, ScreenInfo::OTP, OTP_ZERO, and PlaceX.
void OtpScrSetSwitching | ( | ScreenInfo * | scr, |
WinType | wintype, | ||
bool | switching ) |
Definition at line 1297 of file otp.c.
References ScreenInfo::IconOTP, IconWin, ScreenInfo::OTP, PlaceX, and OtpPreferences::switching.
void OtpScrSetZero | ( | ScreenInfo * | scr, |
WinType | wintype, | ||
int | priority ) |
Definition at line 1309 of file otp.c.
References ABS, ScreenInfo::IconOTP, IconWin, ScreenInfo::OTP, OTP_ZERO, and PlaceX.
name_list ** OtpScrSwitchingL | ( | ScreenInfo * | scr, |
WinType | wintype ) |
Definition at line 1287 of file otp.c.
References ScreenInfo::IconOTP, IconWin, ScreenInfo::OTP, and PlaceX.
Definition at line 1541 of file otp.c.
References TwmWindow::otp, OwlSetAflag(), and PlaceX.
Referenced by fullzoom().
Definition at line 1522 of file otp.c.
References TwmWindow::otp, OwlSetAflagMask(), and PlaceX.
Referenced by EwmhClientMessage_NET_WM_STATEchange().
Definition at line 894 of file otp.c.
References ABS, DPRINTF, TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OTP_ZERO, OtpCheckConsistency(), PlaceX, SetOwlPriority(), and TryToMoveTransientsOfTo().
Referenced by Occupy(), and otp_priority_handler().
Definition at line 1585 of file otp.c.
References TwmWindow::otp, OwlStashAflags(), and OtpWinList::stashed_aflags.
Referenced by otp_priority_handler().
Definition at line 941 of file otp.c.
References TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OTP_MAX, OTP_ZERO, OtpCheckConsistency(), PlaceX, OtpWinList::pri_base, SetOwlPriority(), and TryToMoveTransientsOfTo().
Referenced by otp_priority_handler().
Definition at line 819 of file otp.c.
References EwmhSet_NET_CLIENT_LIST_STACKING(), TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, and TinyLowerOwl().
Referenced by f_tinylower_impl().
Definition at line 805 of file otp.c.
References EwmhSet_NET_CLIENT_LIST_STACKING(), TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, and TinyRaiseOwl().
Referenced by f_tinyraise_impl().
Definition at line 963 of file otp.c.
References TwmWindow::icon, IconWin, Icon::otp, TwmWindow::otp, OtpCheckConsistency(), and PlaceX.
Referenced by otp_priority_handler().
Definition at line 1446 of file otp.c.
References OtpWinList::above, PlaceX, Scr, OtpWinList::twm_win, and WinWin.
Referenced by GotoWorkSpace().
Unfocus a window.
This needs to know internals of OTP because of focus-dependent stacking of it and its transients.
Definition at line 1753 of file otp.c.
References TwmWindow::otp, OtpFocusWindowBE(), PlaceX, PRI, and Scr.
Referenced by HandleFocusIn(), HandleFocusOut(), and SetFocus().
|
static |
Definition at line 1568 of file otp.c.
References OwlStashAflags(), and PlaceX.
Referenced by OtpClearAflag().
|
static |
Definition at line 1812 of file otp.c.
References EWMH_PRI_ABOVE, EWMH_PRI_DOCK, EWMH_PRI_FULLSCREEN, GetTwmWindow(), MAX, MIN, OTP_MAX, OTP_ZERO, PlaceX, Scr, and wt_Dock.
Referenced by OtpEffectiveDisplayPriority(), and OtpEffectivePriority().
|
static |
|
static |
Pretty-print a whole OWL stack.
Works upward from the arg; generally, you'd call this with Scr->bottomOwl.
Definition at line 1485 of file otp.c.
References OtpWinList::above, GetTwmWindow(), OtpEffectiveDisplayPriority(), OtpEffectivePriority(), PlaceX, and WinWin.
Referenced by OtpCheckConsistencyVS().
|
static |
Definition at line 538 of file otp.c.
References PlaceX, PRI, and Scr.
Referenced by InsertOwl(), and TryToMoveTransientsOfTo().
|
static |
Definition at line 1550 of file otp.c.
References OwlStashAflags(), and PlaceX.
Referenced by OtpSetAflag().
|
static |
Definition at line 1530 of file otp.c.
References OwlStashAflags(), and PlaceX.
Referenced by OtpSetAflagMask().
|
static |
Definition at line 1593 of file otp.c.
References dpy, PlaceX, and WinWin.
Referenced by AddNewOwl(), OtpStashAflagsFirstTime(), OwlClearAflag(), OwlSetAflag(), OwlSetAflagMask(), and RecomputeOwlPrefs().
|
static |
Definition at line 734 of file otp.c.
References isHiddenBy(), LowerOwl(), MAX, OTP_MAX, PlaceX, PRI, RaiseOwl(), and shouldStayAbove().
Referenced by OtpRaiseLower().
|
static |
Definition at line 678 of file otp.c.
References InsertOwl(), PlaceX, RemoveOwl(), and TryToSwitch().
Referenced by OtpRaise(), and RaiseLowerOwl().
|
static |
Definition at line 517 of file otp.c.
References OtpWinList::below, InsertOwlAbove(), PlaceX, PRI_CP, RemoveOwl(), shouldStayAbove(), and WinWin.
Referenced by InsertOwl(), and TinyRaiseOwl().
|
static |
Definition at line 1048 of file otp.c.
References ApplyPreferences(), EWMH_STATE_ABOVE, EwmhSet_NET_WM_STATE(), InsertOwl(), OwlStashAflags(), PlaceX, and RemoveOwl().
Referenced by OtpRecomputePrefs().
|
static |
Definition at line 357 of file otp.c.
Referenced by LowerOwl(), OtpFocusWindowBE(), OtpForcePlacement(), OtpRemove(), OtpRestackWindow(), RaiseOwl(), RaiseSmallTransientsOfAbove(), RecomputeOwlPrefs(), ReparentWindow(), ReparentWindowAndIcon(), SetOwlPriority(), TinyLowerOwl(), and TinyRaiseOwl().
int ReparentWindow | ( | Display * | display, |
TwmWindow * | twm_win, | ||
WinType | wintype, | ||
Window | parent, | ||
int | x, | ||
int | y ) |
Definition at line 1378 of file otp.c.
References OtpWinList::below, DPRINTF, TwmWindow::icon, IconWin, InsertOwlAbove(), Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, RemoveOwl(), WindowOfOwl(), x, and y.
Referenced by ReMapOne(), ReparentFrameAndIcon(), and RestoreWinConfig().
void ReparentWindowAndIcon | ( | Display * | display, |
TwmWindow * | twm_win, | ||
Window | parent, | ||
int | win_x, | ||
int | win_y, | ||
int | icon_x, | ||
int | icon_y ) |
Definition at line 1399 of file otp.c.
References OtpWinList::below, DPRINTF, TwmWindow::frame, TwmWindow::icon, InsertOwlAbove(), Icon::otp, TwmWindow::otp, OtpCheckConsistency(), PlaceX, RemoveOwl(), and Icon::w.
Referenced by ReparentFrameAndIcon().
|
static |
Definition at line 600 of file otp.c.
References DPRINTF, InsertOwl(), OTP_MAX, PlaceX, and RemoveOwl().
Referenced by OtpChangePriority(), OtpSetPriority(), OtpSwitchPriority(), and TryToMoveTransientsOfTo().
|
static |
Definition at line 509 of file otp.c.
References isSmallTransientOf(), PlaceX, and WinWin.
Referenced by InsertOwl(), RaiseLowerOwl(), RaiseSmallTransientsOfAbove(), and TinyRaiseOwl().
|
static |
Definition at line 718 of file otp.c.
References OtpWinList::below, InsertOwlAbove(), isHiddenBy(), PlaceX, PRI, and RemoveOwl().
Referenced by OtpTinyLower().
|
static |
Definition at line 700 of file otp.c.
References OtpWinList::above, InsertOwlAbove(), isHiddenBy(), PlaceX, PRI, RaiseSmallTransientsOfAbove(), RemoveOwl(), and shouldStayAbove().
Referenced by OtpTinyRaise().
|
static |
Definition at line 624 of file otp.c.
References OtpWinList::above, isTransientOf(), OwlRightBelow(), PlaceX, PRI, OtpWinList::pri_aflags, Scr, SetOwlPriority(), and WinWin.
Referenced by OtpChangePriority(), OtpSetPriority(), OtpSwitchPriority(), and TryToSwitch().
|
static |
Definition at line 654 of file otp.c.
References OTP_MAX, PlaceX, and TryToMoveTransientsOfTo().
Referenced by LowerOwl(), and RaiseOwl().
|
static |
Definition at line 182 of file otp.c.
References IconWin, and PlaceX.
Referenced by InsertOwlAbove(), OtpCheckConsistencyVS(), and ReparentWindow().