|
CTWM
|
#include "ctwm.h"#include <stdio.h>#include <stdlib.h>#include <sys/time.h>#include <X11/Xatom.h>#include <X11/extensions/shape.h>#include "add_window.h"#include "animate.h"#include "clicktofocus.h"#include "colormaps.h"#include "ctwm_atoms.h"#include "ctwm_shutdown.h"#include "events.h"#include "event_handlers.h"#include "event_internal.h"#include "event_names.h"#include "functions.h"#include "functions_defs.h"#include "gram.tab.h"#include "iconmgr.h"#include "icons.h"#include "image.h"#include "list.h"#include "occupation.h"#include "otp.h"#include "parse.h"#include "screen.h"#include "util.h"#include "vscreen.h"#include "win_decorations.h"#include "win_iconify.h"#include "win_ops.h"#include "win_regions.h"#include "win_resize.h"#include "win_ring.h"#include "win_utils.h"#include "workspace_manager.h"#include "workspace_utils.h"Go to the source code of this file.
Data Structures | |
| struct | HENScanArgs |
| struct | HLNScanArgs |
Macros | |
| #define | MAX_NAME_LEN 200L |
Typedefs | |
| typedef struct HENScanArgs | HENScanArgs |
| typedef struct HLNScanArgs | HLNScanArgs |
Functions | |
| static void | do_key_menu (MenuRoot *menu, Window w) |
| static void | HandleFocusIn (void) |
| static void | HandleFocusOut (void) |
| static void | SendTakeFocusMessage (TwmWindow *tmp, Time timestamp) |
| static unsigned int | set_mask_ignore (unsigned int modifier) |
| void | HandleColormapNotify (void) |
| static XEvent * | LastFocusEvent (Window w, XEvent *first) |
| void | HandleFocusChange (void) |
| void | HandleCirculateNotify (void) |
| void | HandleVisibilityNotify (void) |
| void | HandleKeyRelease (void) |
| void | HandleKeyPress (void) |
| void | HandlePropertyNotify (void) |
| void | HandleClientMessage (void) |
| static void | flush_expose (Window w) |
| void | HandleExpose (void) |
| static void | remove_window_from_ring (TwmWindow *tmp) |
| void | HandleDestroyNotify (void) |
| void | HandleCreateNotify (void) |
| void | HandleMapRequest (void) |
| void | HandleMapNotify (void) |
| void | HandleUnmapNotify (void) |
| void | HandleMotionNotify (void) |
| void | HandleButtonRelease (void) |
| static void | do_menu (MenuRoot *menu, Window w) |
| void | HandleButtonPress (void) |
| static Bool | HENQueueScanner (Display *display, XEvent *ev, char *_args) |
| void | HandleEnterNotify (void) |
| static Bool | HLNQueueScanner (Display *display, XEvent *ev, char *_args) |
| void | HandleLeaveNotify (void) |
| void | HandleConfigureRequest (void) |
| void | HandleShapeNotify (void) |
| void | HandleUnknown (void) |
Variables | |
| static char * | Action |
| static TwmWindow * | ButtonWindow |
| #define MAX_NAME_LEN 200L |
Referenced by HandlePropertyNotify().
| typedef struct HENScanArgs HENScanArgs |
| typedef struct HLNScanArgs HLNScanArgs |
|
static |
Definition at line 2564 of file event_handlers.c.
References do_key_menu(), dpy, Event, PopUpMenu(), Scr, and UpdateMenu().
Referenced by do_key_menu(), and HandleKeyPress().
|
static |
Definition at line 2531 of file event_handlers.c.
References do_menu(), dpy, Event, PopUpMenu(), Scr, and UpdateMenu().
Referenced by do_menu(), and HandleButtonPress().
|
static |
Definition at line 3908 of file event_handlers.c.
References dpy, and flush_expose().
Referenced by flush_expose(), and HandleExpose().
| void HandleButtonPress | ( | void | ) |
Definition at line 2606 of file event_handlers.c.
References Action, MenuItem::action, TitleButtonFunc::action, ActiveItem, ActiveMenu, AlternateContext, AlternateKeymap, ButtonPressed, ButtonWindow, C_ALTERNATE, C_FRAME, C_ICON, C_ICONMGR, C_IDENTIFY, C_NO_CONTEXT, C_ROOT, C_TITLE, C_WINDOW, C_WORKSPACE, Cancel, FuncButton::cont, Context, CurrentDragX, CurrentDragY, do_menu(), WList::down, DownIconManager, dpy, DragWindow, DrawIconManagerBorder(), Event, ExecuteFunction(), TwmWindow::frame, TwmWindow::frame_bw3D, FuncButton::func, MenuItem::func, TitleButtonFunc::func, TitleButton::funs, GetTwmWindow(), HandleButtonPress(), TwmWindow::icon, WList::icon, TwmWindow::iconmanagerlist, WList::iconmgr, TBWindow::info, TwmWindow::iswspmgr, FuncButton::item, JunkChild, LeftButt, FuncButton::menu, MenuContext, menuFromFrameOrWindowOrTitlebar, TitleButtonFunc::menuroot, MiddleButt, FuncButton::mods, TitleButtonFunc::mods, mods_used, MoveMenu(), MoveOutline(), FuncButton::next, TitleButtonFunc::next, FuncButton::num, TitleButtonFunc::num, OccupyHandleButtonEvent(), origDragX, origDragY, OtpRaise(), MenuRoot::pinned, PopDownMenu(), ResizeWindow, RightButt, RootFunction, Scr, set_mask_ignore(), SetFocus(), TwmWindow::title_height, TwmWindow::title_w, TwmWindow::titlebuttons, Tmp_win, IconMgr::twm_win, UninstallRootColormap(), Icon::w, MenuRoot::w, TwmWindow::w, WList::w, TBWindow::window, WinWin, WMapRaise(), WMgrHandleButtonEvent(), TwmWindow::wmhints, and wt_Desktop.
Referenced by HandleButtonPress().
| void HandleButtonRelease | ( | void | ) |
Definition at line 2255 of file event_handlers.c.
References Action, MenuItem::action, ActiveItem, ActiveMenu, AddToWorkSpace(), AlternateContext, AlternateKeymap, ButtonPressed, ButtonWindow, C_IDENTIFY, C_NO_CONTEXT, Cancel, ConstMove, ConstMoveDir, ConstMoveX, ConstMoveY, ConstrainByBorders(), Context, CurrentDragX, CurrentDragY, WorkSpaceWindow::currentwspc, MenuRoot::defaultitem, WList::down, DownIconManager, dpy, DragBW, DragHeight, DragWidth, DragWindow, DragX, DragY, DrawIconManagerBorder(), EndResize(), enter_flag, enter_win, MenuRoot::entered, Event, EventHandler, ExecuteFunction(), TwmWindow::frame, TwmWindow::frame_bw, TwmWindow::frame_height, TwmWindow::frame_width, MenuItem::func, GetTwmWindow(), HandleButtonRelease(), HandleEnterNotify(), HandleLeaveNotify(), TwmWindow::icon, IconWin, JunkChild, leave_flag, leave_win, lower_win, MOVE_HORIZ, MOVE_NONE, MOVE_VERT, MoveFunction, MoveOutline(), WorkSpace::name, OtpRaise(), PopDownMenu(), raise_win, RemoveFromWorkSpace(), ResizeWindow, RootFunction, Scr, SetupWindow(), Tmp_win, TryToGrid(), TryToPack(), TryToPush(), UninstallRootColormap(), TwmWindow::vs, Icon::w, Icon::w_x, Icon::w_y, WarpCursorToDefaultEntry(), VirtualScreen::window, WinWin, and VirtualScreen::wsw.
Referenced by HandleButtonRelease().
| void HandleCirculateNotify | ( | void | ) |
Definition at line 439 of file event_handlers.c.
References Event, TwmWindow::frame, GetTwmWindow(), HandleCirculateNotify(), TwmWindow::icon, IconWin, VirtualScreen::next, OtpHandleCirculateNotify(), Scr, Icon::w, VirtualScreen::window, and WinWin.
Referenced by HandleCirculateNotify(), and OtpCirculateSubwindows().
| void HandleClientMessage | ( | void | ) |
Definition at line 1543 of file event_handlers.c.
References Animating, dpy, Event, EwmhClientMessage(), ExecuteFunction(), HandleClientMessage(), TwmWindow::isicon, JunkChild, JunkMask, JunkRoot, JunkX, JunkY, Scr, and Tmp_win.
Referenced by HandleClientMessage().
| void HandleColormapNotify | ( | void | ) |
Definition at line 107 of file event_handlers.c.
References TwmColormap::c, CM_INSTALLABLE, CM_INSTALLED, ColormapWindow::colormap, ColormapContext, ColortableThrashing, CreateTwmColormap(), dpy, Event, HandleColormapNotify(), InstallColormaps(), TwmColormap::refcnt, Scr, and TwmColormap::state.
Referenced by HandleColormapNotify().
| void HandleConfigureRequest | ( | void | ) |
Definition at line 3679 of file event_handlers.c.
References dpy, Event, TwmWindow::frame_bw, TwmWindow::frame_bw3D, TwmWindow::frame_height, TwmWindow::frame_width, TwmWindow::frame_x, TwmWindow::frame_y, GetGravityOffsets(), GetTwmWindow(), HandleConfigureRequest(), TwmWindow::icon, TwmWindow::old_bw, OtpForcePlacement(), OtpLower(), OtpRaise(), OtpRaiseLower(), Scr, SetupFrame(), TwmWindow::stackmode, TwmWindow::title_height, Tmp_win, unzoom(), Icon::w, and WinWin.
Referenced by HandleConfigureRequest().
| void HandleCreateNotify | ( | void | ) |
Definition at line 1901 of file event_handlers.c.
References dpy, Event, and HandleCreateNotify().
Referenced by HandleCreateNotify().
| void HandleDestroyNotify | ( | void | ) |
Definition at line 1720 of file event_handlers.c.
References TwmWindow::auto_lower, TwmWindow::auto_raise, TwmWindow::class, TwmWindow::cmaps, TwmWindow::_names::ctwm_wm_icon_name, TwmWindow::_names::ctwm_wm_name, DeleteHighlightWindows(), DeleteIcon(), DeleteIconsList(), dpy, EwmhDeleteClientWindow(), EwmhSet_NET_CLIENT_LIST_STACKING(), FocusOnRoot(), TwmWindow::frame, free_cwins(), FreeWMPropertyString(), TwmWindow::gray, HandleDestroyNotify(), TwmWindow::hilite_wl, TwmWindow::hilite_wr, TwmWindow::icon, IconDown(), IconWin, InstallColormaps(), TwmWindow::lolite_wl, TwmWindow::lolite_wr, TwmWindow::names, TwmWindow::next, WorkSpace::next, NoName, TwmWindow::occupation, OtpRemove(), TwmWindow::prev, remove_window_from_ring(), RemoveIconManager(), RemoveWindowFromRegion(), WorkSpace::save_focus, Scr, ScreenContext, set_last_window(), TwmWindow::squeeze_info, TwmWindow::squeeze_info_copied, TwmWindow::title_height, TwmWindow::title_w, TwmWindow::titlebuttons, Tmp_win, TwmContext, Icon::w, TwmWindow::w, Icon::w_not_ours, TBWindow::window, WinWin, TwmWindow::_names::wm_icon_name, TwmWindow::_names::wm_name, WMapRemoveWindow(), and TwmWindow::wmhints.
Referenced by HandleDestroyNotify(), and HandleUnmapNotify().
| void HandleEnterNotify | ( | void | ) |
Definition at line 3073 of file event_handlers.c.
References ActiveItem, ActiveMenu, TwmWindow::auto_raise, AutoRaiseWindow(), C_ROOT, ColormapContext, Context, CurrentIconManagerEntry(), DoesWmTakeFocus, dpy, enter_flag, enter_win, MenuRoot::entered, HENScanArgs::enters, Event, ExpandIconTitle(), MenuRoot::first, TwmWindow::frame, VirtualScreen::h, HandleEnterNotify(), HENQueueScanner(), HideMenu(), TwmWindow::icon, TwmWindow::iconmanagerlist, WList::iconmgr, IconWin, InstallColormaps(), InstallWindowColormaps(), JunkChild, JunkMask, JunkRoot, HENScanArgs::leaves, TwmWindow::mapped, MenuContext, MenuDepth, MenuItem::next, VirtualScreen::next, OtpRaise(), PaintEntry(), MenuRoot::pinned, PopUpMenu(), MenuRoot::prev, TwmWindow::protocols, raise_win, RaiseDelay, RootFunction, Scr, SendTakeFocusMessage(), SetBorderCursor(), SetFocus(), MenuItem::state, SynthesiseFocusIn(), Tmp_win, IconMgr::twm_win, UninstallRootColormap(), UpdateMenu(), ColormapWindow::visibility, HENScanArgs::w, Icon::w, MenuRoot::w, TwmWindow::w, VirtualScreen::w, WList::w, VirtualScreen::window, WindowIsOnRing, TwmWindow::wmhints, VirtualScreen::x, and VirtualScreen::y.
Referenced by HandleButtonRelease(), and HandleEnterNotify().
| void HandleExpose | ( | void | ) |
Definition at line 1591 of file event_handlers.c.
References TwmWindow::class, dpy, draw_info_window(), DrawIconManagerIconName(), Event, flush_expose(), TwmWindow::frame, HandleExpose(), TwmWindow::icon, WList::icon, TwmWindow::iconmanagerlist, LookInList(), MenuContext, TwmWindow::name, VirtualScreen::next, PaintBorders(), PaintIcon(), PaintMenu(), PaintOccupyWindow(), PaintTitle(), PaintTitleButton(), Scr, ShowIconifiedIcon(), TwmWindow::title_w, TwmWindow::titlebuttons, Tmp_win, WorkSpaceWindow::twm_win, Icon::w, WList::w, TBWindow::window, WMgrHandleExposeEvent(), and VirtualScreen::wsw.
Referenced by DispatchEvent2(), and HandleExpose().
| void HandleFocusChange | ( | void | ) |
Definition at line 314 of file event_handlers.c.
References Event, HandleFocusChange(), HandleFocusIn(), HandleFocusOut(), TwmWindow::isiconmgr, LastFocusEvent(), Tmp_win, and TwmWindow::w.
Referenced by HandleFocusChange(), and InitEvents().
|
static |
Definition at line 369 of file event_handlers.c.
References AutoSqueeze(), TwmWindow::AutoSqueeze, HandleFocusIn(), OtpFocusWindow(), OtpIsFocusDependent(), OtpUnfocusWindow(), Scr, SetFocusVisualAttributes(), TwmWindow::squeezed, Tmp_win, and TwmWindow::wmhints.
Referenced by HandleFocusChange(), and HandleFocusIn().
|
static |
Definition at line 405 of file event_handlers.c.
References AutoSqueeze(), TwmWindow::AutoSqueeze, HandleFocusOut(), OtpIsFocusDependent(), OtpUnfocusWindow(), Scr, SetFocusVisualAttributes(), TwmWindow::squeezed, and Tmp_win.
Referenced by HandleFocusChange(), and HandleFocusOut().
| void HandleKeyPress | ( | void | ) |
Definition at line 545 of file event_handlers.c.
References MenuItem::action, ActiveItem, ActiveMenu, AlternateContext, AlternateKeymap, ButtonWindow, C_ALTERNATE, C_FRAME, C_ICON, C_ICONMGR, C_NAME, C_NO_CONTEXT, C_ROOT, C_TITLE, C_WINDOW, C_WORKSPACE, TwmWindow::class, Context, CurrentSelectedWorkspace, do_key_menu(), dpy, Event, ExecuteFunction(), MenuRoot::first, TwmWindow::frame, MenuItem::func, GetTwmWindow(), GotoWorkSpaceByName(), HandleKeyPress(), MenuRoot::height, TwmWindow::icon, WList::icon, TwmWindow::iconmanagerlist, Islower, Isupper, TwmWindow::iswspmgr, MenuItem::item, MenuItem::item_num, MenuRoot::lastactive, MenuDepth, mods_used, TwmWindow::name, MenuItem::next, TwmWindow::next, PaintEntry(), MenuRoot::pinned, PopDownMenu(), MenuRoot::prev, Scr, set_mask_ignore(), MenuRoot::shadow, MenuItem::state, MenuItem::sub, TwmWindow::title_w, Tmp_win, Tolower, Icon::w, MenuRoot::w, TwmWindow::w, WList::w, MenuRoot::width, WMgrHandleKeyPressEvent(), and wt_Desktop.
Referenced by HandleKeyPress().
| void HandleKeyRelease | ( | void | ) |
Definition at line 526 of file event_handlers.c.
References Event, HandleKeyRelease(), Scr, Tmp_win, and WMgrHandleKeyReleaseEvent().
Referenced by HandleKeyRelease().
| void HandleLeaveNotify | ( | void | ) |
Definition at line 3496 of file event_handlers.c.
References ActiveMenu, TwmWindow::auto_lower, AutoLowerWindow(), TwmWindow::_ring::curs_x, TwmWindow::_ring::curs_y, TwmWindow::_ring::cursor_valid, DoesWmTakeFocus, dpy, HLNScanArgs::enters, Event, TwmWindow::frame, TwmWindow::frame_x, TwmWindow::frame_y, HandleLeaveNotify(), HLNQueueScanner(), TwmWindow::icon, TwmWindow::iconmanagerlist, InstallColormaps(), leave_flag, leave_win, lower_win, TwmWindow::mapped, HLNScanArgs::matches, MenuRoot::pinned, PopDownMenu(), TwmWindow::protocols, TwmWindow::ring, Scr, SetFocus(), ShrinkIconTitle(), SynthesiseFocusOut(), Tmp_win, HLNScanArgs::w, Icon::w, MenuRoot::w, TwmWindow::w, WList::w, and TwmWindow::wmhints.
Referenced by HandleButtonRelease(), and HandleLeaveNotify().
| void HandleMapNotify | ( | void | ) |
Definition at line 2068 of file event_handlers.c.
References dpy, TwmWindow::frame, HandleMapNotify(), TwmWindow::hilite_wl, TwmWindow::hilite_wr, TwmWindow::icon, TwmWindow::icon_on, TwmWindow::isicon, TwmWindow::lolite_wl, TwmWindow::lolite_wr, TwmWindow::mapped, Scr, Tmp_win, and Icon::w.
Referenced by HandleMapNotify().
| void HandleMapRequest | ( | void | ) |
Definition at line 1921 of file event_handlers.c.
References AddIconManager(), AddToWorkSpace(), AddWindow(), AWT_NORMAL, TwmWindow::class, DeIconify(), dpy, Event, EWMH_STATE_ALL, EwmhAddClientWindow(), EwmhSet_NET_CLIENT_LIST_STACKING(), EwmhSet_NET_WM_STATE(), TwmWindow::frame, GetTwmWindow(), GetWMState(), HandleMapRequest(), HandlingEvents, Iconify(), TwmWindow::iconmanagerlist, TwmWindow::isicon, TwmWindow::isiconmgr, TwmWindow::istransient, LookInList(), TwmWindow::mapped, MaybeAnimate, TwmWindow::name, OCCUPY, OtpRaise(), RestartPreviousState, Scr, SetFocus(), SetMapStateProp(), SetRaiseWindow(), Squeeze(), TwmWindow::squeezed, TwmWindow::StartSqueezed, Tmp_win, TwmWindow::UnmapByMovingFarAway, TwmWindow::w, WinWin, WMapMapWindow(), and TwmWindow::wmhints.
Referenced by HandleMapRequest(), and SimulateMapRequest().
| void HandleMotionNotify | ( | void | ) |
Definition at line 2215 of file event_handlers.c.
References DoResize(), dpy, Event, FixRootEvent(), TwmWindow::frame, GetTwmWindow(), HandleMotionNotify(), JunkChild, JunkMask, ResizeOrigX, ResizeOrigY, ResizeWindow, Scr, SetBorderCursor(), Tmp_win, and WindowMoved.
Referenced by HandleMotionNotify().
| void HandlePropertyNotify | ( | void | ) |
Definition at line 1125 of file event_handlers.c.
References AllocImage(), apply_window_icon_name(), apply_window_name(), AutoPopupMaybe(), ColorPair::back, Icon::bm_w, ChangeOccupation(), TwmWindow::_names::ctwm_wm_icon_name, TwmWindow::_names::ctwm_wm_name, dpy, Event, EwmhHandlePropertyNotify(), FB, FetchWmColormapWindows(), FetchWmProtocols(), TwmWindow::forced, ColorPair::fore, FreeWMPropertyString(), GetIconOffset(), GetMaskFromProperty(), GetWindowSizeHints(), GetWMPropertyString(), GotoWorkSpaceByName(), HandlePropertyNotify(), Icon::height, Image::height, TwmWindow::icon, Icon::iconc, Icon::image, InsertRGBColormap(), TwmWindow::isicon, JunkBW, JunkDepth, JunkHeight, JunkRoot, JunkWidth, JunkX, JunkY, Image::mask, Icon::match, match_icon_pixmap_hint, match_net_wm_icon, MAX_NAME_LEN, munge_wmhints(), TwmWindow::names, Image::pixmap, RedoIconName(), ReleaseIconImage(), RemoveRGBColormap(), Scr, ScreenContext, Tmp_win, TwmContext, Icon::w, TwmWindow::w, Icon::w_not_ours, Icon::width, Image::width, TwmWindow::_names::wm_icon_name, TwmWindow::_names::wm_name, and TwmWindow::wmhints.
Referenced by HandlePropertyNotify().
| void HandleShapeNotify | ( | void | ) |
Definition at line 3854 of file event_handlers.c.
References dpy, Event, TwmWindow::frame, HandleShapeNotify(), SetFrameShape(), Tmp_win, and TwmWindow::wShaped.
Referenced by HandleShapeNotify(), and InitEvents().
| void HandleUnknown | ( | void | ) |
Definition at line 3900 of file event_handlers.c.
References Event, and HandleUnknown().
Referenced by f_movetitlebar_impl(), f_resize_impl(), HandleUnknown(), InitEvents(), and movewindow().
| void HandleUnmapNotify | ( | void | ) |
Definition at line 2131 of file event_handlers.c.
References TwmWindow::attr, dpy, Event, EwmhUnmapNotify(), TwmWindow::frame, GetTwmWindow(), HandleDestroyNotify(), HandleUnmapNotify(), TwmWindow::icon, TwmWindow::isicon, TwmWindow::mapped, TwmWindow::old_bw, RestoreWinConfig(), SetMapStateProp(), Tmp_win, Icon::w, and TwmWindow::wmhints.
Referenced by HandleUnmapNotify().
| void HandleVisibilityNotify | ( | void | ) |
Definition at line 488 of file event_handlers.c.
References CM_INSTALLABLE, ColormapWindow::colormap, ColormapContext, dpy, Event, HandleVisibilityNotify(), InstallWindowColormaps(), TwmColormap::state, ColormapWindow::visibility, ColormapWindow::w, and TwmColormap::w.
Referenced by HandleVisibilityNotify().
|
static |
Definition at line 3040 of file event_handlers.c.
References HENScanArgs::enters, HENQueueScanner(), HENScanArgs::inferior, HENScanArgs::leaves, and HENScanArgs::w.
Referenced by HandleEnterNotify(), and HENQueueScanner().
|
static |
Definition at line 3473 of file event_handlers.c.
References HLNScanArgs::enters, HLNQueueScanner(), HLNScanArgs::matches, and HLNScanArgs::w.
Referenced by HandleLeaveNotify(), and HLNQueueScanner().
|
static |
Definition at line 263 of file event_handlers.c.
References dpy, LastFocusEvent(), and Tmp_win.
Referenced by HandleFocusChange(), and LastFocusEvent().
|
static |
Definition at line 1691 of file event_handlers.c.
References enter_flag, enter_win, leave_flag, leave_win, lower_win, raise_win, remove_window_from_ring(), Tmp_win, and UnlinkWindowFromRing().
Referenced by HandleDestroyNotify(), and remove_window_from_ring().
|
static |
Definition at line 3920 of file event_handlers.c.
References send_clientmessage(), SendTakeFocusMessage(), and TwmWindow::w.
Referenced by HandleEnterNotify(), and SendTakeFocusMessage().
|
static |
Definition at line 87 of file event_handlers.c.
References Scr, and set_mask_ignore().
Referenced by HandleButtonPress(), HandleKeyPress(), and set_mask_ignore().
|
static |
Definition at line 80 of file event_handlers.c.
Referenced by GotButton(), GotKey(), GotTitleButton(), HandleButtonPress(), and HandleButtonRelease().
|
static |
Definition at line 82 of file event_handlers.c.
Referenced by HandleButtonPress(), HandleButtonRelease(), and HandleKeyPress().