|
CTWM
|
#include "ctwm.h"#include <stdio.h>#include <stdlib.h>#include <X11/Xatom.h>#include "add_window.h"#include "ctwm_atoms.h"#include "drawing.h"#include "events.h"#include "event_internal.h"#include "icons.h"#include "list.h"#include "occupation.h"#include "otp.h"#include "r_area.h"#include "r_area_list.h"#include "r_layout.h"#include "screen.h"#include "util.h"#include "win_decorations.h"#include "win_ops.h"#include "win_utils.h"#include "workspace_utils.h"Go to the source code of this file.
Macros | |
| #define | TRY(fld) |
| #define | TRY(fld) |
Enumerations | |
| enum | PushDirection { PD_ANY , PD_BOTTOM , PD_LEFT , PD_RIGHT , PD_TOP } |
Functions | |
| void | GetWindowSizeHints (TwmWindow *tmp) |
| void | FetchWmProtocols (TwmWindow *tmp) |
| void | GetGravityOffsets (TwmWindow *tmp, int *xp, int *yp) |
| TwmWindow * | GetTwmWindow (Window w) |
| char * | GetWMPropertyString (Window w, Atom prop) |
| void | FreeWMPropertyString (char *prop) |
| bool | visible (const TwmWindow *tmp_win) |
| long | mask_out_event (Window w, long ignore_event) |
| long | mask_out_event_mask (Window w, long ignore_event, long curmask) |
| int | restore_mask (Window w, long restore) |
| void | SetMapStateProp (TwmWindow *tmp_win, int state) |
| bool | GetWMState (Window w, int *statep, Window *iwp) |
| void | DisplayPosition (const TwmWindow *_unused_tmp_win, int x, int y) |
| void | MoveResizeSizeWindow (int x, int y, unsigned int width, unsigned int height) |
| static void | _tryToPack (RArea *final, const RArea *cur_win) |
| static bool | _tryToPackVsEachMonitor (const RArea *monitor_area, void *vfinal) |
| void | TryToPack (TwmWindow *tmp_win, int *x, int *y) |
| static void | TryToPush_be (TwmWindow *tmp_win, int x, int y, PushDirection dir) |
| void | TryToPush (TwmWindow *tmp_win, int x, int y) |
| void | TryToGrid (TwmWindow *tmp_win, int *x, int *y) |
| bool | ConstrainByLayout (RLayout *layout, int move_off_res, int *left, int width, int *top, int height) |
| void | ConstrainByBorders1 (int *left, int width, int *top, int height) |
| void | ConstrainByBorders (TwmWindow *twmwin, int *left, int width, int *top, int height) |
| void | WarpToWindow (TwmWindow *t, bool must_raise) |
| void | send_clientmessage (Window w, Atom a, Time timestamp) |
| XWMHints * | gen_synthetic_wmhints (TwmWindow *win) |
| XWMHints * | munge_wmhints (TwmWindow *win, XWMHints *hints) |
| Perform whatever adaptations of WM_HINTS info we do. | |
| bool | set_window_name (TwmWindow *win) |
| [Re]set a window's name. | |
| void | apply_window_name (TwmWindow *win) |
| [Re]set and apply changes to a window's name. | |
| bool | set_window_icon_name (TwmWindow *win) |
| [Re]set a window's icon name. | |
| void | apply_window_icon_name (TwmWindow *win) |
| [Re]set and apply changes to a window's icon name. | |
| #define TRY | ( | fld | ) |
| #define TRY | ( | fld | ) |
Referenced by set_window_icon_name(), and set_window_name().
| enum PushDirection |
| Enumerator | |
|---|---|
| PD_ANY | |
| PD_BOTTOM | |
| PD_LEFT | |
| PD_RIGHT | |
| PD_TOP | |
Definition at line 607 of file win_utils.c.
Definition at line 516 of file win_utils.c.
References RArea::height, MAX, MIN, Scr, RArea::width, RArea::x, and RArea::y.
Referenced by _tryToPackVsEachMonitor(), and TryToPack().
|
static |
| void apply_window_icon_name | ( | TwmWindow * | win | ) |
[Re]set and apply changes to a window's icon name.
This is called after we've received a new WM_ICON_NAME (or other name-setting) property, to update our titlebars, icon managers, etc.
Definition at line 1349 of file win_utils.c.
References AutoPopupMaybe(), RedoIcon(), set_window_icon_name(), and Tmp_win.
Referenced by apply_window_name(), EwmhHandlePropertyNotify(), and HandlePropertyNotify().
| void apply_window_name | ( | TwmWindow * | win | ) |
[Re]set and apply changes to a window's name.
This is called after we've received a new WM_NAME (or other name-setting) property, to update our titlebars, icon managers, etc.
Definition at line 1187 of file win_utils.c.
References apply_window_icon_name(), AutoPopupMaybe(), ColorPair::back, TwmWindow::border_tile, TwmWindow::borderC, TwmWindow::class, dpy, ColorPair::fore, TwmWindow::frame_height, TwmWindow::frame_width, TwmWindow::frame_x, TwmWindow::frame_y, GetColorFromList(), GetShadeColors(), TwmWindow::_names::icon_set, TwmWindow::name, TwmWindow::name_width, TwmWindow::nameChanged, TwmWindow::names, OtpRecomputePrefs(), Scr, set_window_name(), SetupWindow(), TwmWindow::title, TwmWindow::title_w, and WmgrRedoOccupation().
Referenced by EwmhHandlePropertyNotify(), and HandlePropertyNotify().
| void ConstrainByBorders | ( | TwmWindow * | twmwin, |
| int * | left, | ||
| int | width, | ||
| int * | top, | ||
| int | height ) |
Definition at line 825 of file win_utils.c.
References ConstrainByBorders1(), and dpy.
Referenced by AddWindow(), HandleButtonRelease(), movewindow(), and TryToPush_be().
| void ConstrainByBorders1 | ( | int * | left, |
| int | width, | ||
| int * | top, | ||
| int | height ) |
Definition at line 818 of file win_utils.c.
References ConstrainByLayout(), and Scr.
Referenced by ConstrainByBorders(), and MoveMenu().
| bool ConstrainByLayout | ( | RLayout * | layout, |
| int | move_off_res, | ||
| int * | left, | ||
| int | width, | ||
| int * | top, | ||
| int | height ) |
Definition at line 760 of file win_utils.c.
References RAreaNew(), RLayoutFindBottomEdge(), RLayoutFindLeftEdge(), RLayoutFindRightEdge(), RLayoutFindTopEdge(), RArea::x, and RArea::y.
Referenced by ConstrainByBorders1(), Occupy(), and PopUpMenu().
| void DisplayPosition | ( | const TwmWindow * | _unused_tmp_win, |
| int | x, | ||
| int | y ) |
Definition at line 466 of file win_utils.c.
References dpy, Draw3DBorder(), FB, off, Scr, SIZE_HINDENT, SIZE_VINDENT, x, and y.
Referenced by AddWindow(), and movewindow().
| void FetchWmProtocols | ( | TwmWindow * | tmp | ) |
Definition at line 108 of file win_utils.c.
References DoesWmDeleteWindow, DoesWmSaveYourself, DoesWmTakeFocus, dpy, TwmWindow::protocols, and TwmWindow::w.
Referenced by AddWindow(), and HandlePropertyNotify().
| void FreeWMPropertyString | ( | char * | prop | ) |
Definition at line 327 of file win_utils.c.
References NoName.
Referenced by EwmhHandlePropertyNotify(), HandleDestroyNotify(), and HandlePropertyNotify().
| XWMHints * gen_synthetic_wmhints | ( | TwmWindow * | win | ) |
Definition at line 1030 of file win_utils.c.
Referenced by AddWindow().
| void GetGravityOffsets | ( | TwmWindow * | tmp, |
| int * | xp, | ||
| int * | yp ) |
Definition at line 149 of file win_utils.c.
References TwmWindow::hints, x, and y.
Referenced by AddWindow(), HandleConfigureRequest(), and RestoreWinConfig().
| TwmWindow * GetTwmWindow | ( | Window | w | ) |
Definition at line 190 of file win_utils.c.
References dpy, and TwmContext.
Referenced by AddWindow(), CanChangeOccupation(), DeIconify(), DispatchEvent(), DispatchEvent2(), EndResize(), EwmhClientMessage_NET_ACTIVE_WINDOW(), EwmhClientMessage_NET_CLOSE_WINDOW(), EwmhClientMessage_NET_WM_DESKTOP(), EwmhClientMessage_NET_WM_MOVERESIZE(), EwmhClientMessage_NET_WM_STATE(), HandleButtonPress(), HandleButtonRelease(), HandleCirculateNotify(), HandleConfigureRequest(), HandleKeyPress(), HandleMapRequest(), HandleMotionNotify(), HandleUnmapNotify(), Iconify(), munge_wmhints(), OwlEffectivePriority(), OwlPrettyPrint(), SetupOccupation(), WarpAlongRing(), and WMapRestack().
| void GetWindowSizeHints | ( | TwmWindow * | tmp | ) |
Definition at line 41 of file win_utils.c.
References TwmWindow::attr, dpy, TwmWindow::frame_bw3D, TwmWindow::hints, TwmWindow::old_bw, Scr, TwmWindow::title_height, and TwmWindow::w.
Referenced by AddWindow(), and HandlePropertyNotify().
| char * GetWMPropertyString | ( | Window | w, |
| Atom | prop ) |
Definition at line 222 of file win_utils.c.
References dpy, ProgramName, and Scr.
Referenced by AddWindow(), EwmhHandlePropertyNotify(), and HandlePropertyNotify().
| bool GetWMState | ( | Window | w, |
| int * | statep, | ||
| Window * | iwp ) |
Definition at line 429 of file win_utils.c.
References dpy.
Referenced by HandleMapRequest(), and SetupOccupation().
| long mask_out_event | ( | Window | w, |
| long | ignore_event ) |
Definition at line 366 of file win_utils.c.
References dpy, and mask_out_event_mask().
Referenced by ChangeOccupation(), DisplayWinUnchecked(), GotoWorkSpace(), Iconify(), SetupOccupation(), Squeeze(), and Vanish().
| long mask_out_event_mask | ( | Window | w, |
| long | ignore_event, | ||
| long | curmask ) |
Definition at line 389 of file win_utils.c.
References dpy.
Referenced by Iconify(), mask_out_event(), and UnmapTransients().
| void MoveResizeSizeWindow | ( | int | x, |
| int | y, | ||
| unsigned int | width, | ||
| unsigned int | height ) |
Definition at line 495 of file win_utils.c.
References dpy, RArea::height, RLayoutGetAreaAtXY(), Scr, RArea::width, RArea::x, x, RArea::y, and y.
Referenced by AddWindow(), MenuStartResize(), movewindow(), and StartResize().
| XWMHints * munge_wmhints | ( | TwmWindow * | win, |
| XWMHints * | hints ) |
Perform whatever adaptations of WM_HINTS info we do.
Most of these relate to focus, but we also fiddle with group membership.
Definition at line 1059 of file win_utils.c.
References GetTwmWindow(), TwmWindow::group, IsInList(), Scr, and TwmWindow::w.
Referenced by AddWindow(), and HandlePropertyNotify().
| int restore_mask | ( | Window | w, |
| long | restore ) |
Definition at line 399 of file win_utils.c.
References dpy.
Referenced by ChangeOccupation(), DisplayWinUnchecked(), GotoWorkSpace(), Iconify(), SetupOccupation(), Squeeze(), UnmapTransients(), and Vanish().
| void send_clientmessage | ( | Window | w, |
| Atom | a, | ||
| Time | timestamp ) |
Definition at line 996 of file win_utils.c.
References dpy.
Referenced by Animate(), f_saveyourself_impl(), SendDeleteWindowMessage(), and SendTakeFocusMessage().
| bool set_window_icon_name | ( | TwmWindow * | win | ) |
[Re]set a window's icon name.
As with the window name version in set_window_name(), this is mostly separate so the AddWindow() process can call it.
Definition at line 1288 of file win_utils.c.
References dpy, TwmWindow::icon_name, TwmWindow::_names::icon_set, TwmWindow::name, TwmWindow::names, TRY, TwmWindow::w, and TwmWindow::_names::wm_icon_name.
Referenced by AddWindow(), and apply_window_icon_name().
| bool set_window_name | ( | TwmWindow * | win | ) |
[Re]set a window's name.
This goes over the available naming sources for the window and points the TwmWindow::name at the appropriate one. It may also set a property to signal other EWMH-aware clients when we're naming it a way they can't see themselves.
Definition at line 1126 of file win_utils.c.
References dpy, TwmWindow::name, TwmWindow::names, NoName, TRY, TwmWindow::w, and TwmWindow::_names::wm_name.
Referenced by AddWindow(), and apply_window_name().
| void SetMapStateProp | ( | TwmWindow * | tmp_win, |
| int | state ) |
Definition at line 415 of file win_utils.c.
References dpy, TwmWindow::icon, TwmWindow::iconify_by_unmapping, Icon::w, and TwmWindow::w.
Referenced by AddIconManager(), CreateIconManagers(), CreateOccupyWindow(), CreateWorkSpaceManagerWindow(), ctwm_main(), DisplayWinUnchecked(), f_showiconmgr_impl(), HandleMapRequest(), HandleUnmapNotify(), HideIconManager(), Iconify(), Occupy(), ReMapOne(), SetupOccupation(), UnmapTransients(), and Vanish().
| void TryToGrid | ( | TwmWindow * | tmp_win, |
| int * | x, | ||
| int * | y ) |
Definition at line 705 of file win_utils.c.
References TwmWindow::frame_bw, TwmWindow::frame_height, TwmWindow::frame_width, TwmWindow::hints, Scr, x, and y.
Referenced by AddWindow(), HandleButtonRelease(), and movewindow().
| void TryToPack | ( | TwmWindow * | tmp_win, |
| int * | x, | ||
| int * | y ) |
Definition at line 560 of file win_utils.c.
References _tryToPack(), _tryToPackVsEachMonitor(), TwmWindow::frame_bw, TwmWindow::frame_height, TwmWindow::frame_width, TwmWindow::frame_x, TwmWindow::frame_y, TwmWindow::mapped, TwmWindow::next, RAreaListForeach(), RAreaNew(), Scr, TwmWindow::vs, x, and y.
Referenced by AddWindow(), HandleButtonRelease(), movewindow(), and TryToPush_be().
| void TryToPush | ( | TwmWindow * | tmp_win, |
| int | x, | ||
| int | y ) |
Definition at line 617 of file win_utils.c.
References PD_ANY, TryToPush_be(), x, and y.
Referenced by HandleButtonRelease(), and movewindow().
|
static |
Definition at line 623 of file win_utils.c.
References ConstrainByBorders(), TwmWindow::frame_bw, TwmWindow::frame_height, TwmWindow::frame_width, TwmWindow::frame_x, TwmWindow::frame_y, TwmWindow::mapped, TwmWindow::next, PD_ANY, PD_BOTTOM, PD_LEFT, PD_RIGHT, PD_TOP, Scr, SetupWindow(), TryToPack(), TryToPush_be(), TwmWindow::vs, x, and y.
Referenced by TryToPush(), and TryToPush_be().
| bool visible | ( | const TwmWindow * | tmp_win | ) |
Definition at line 341 of file win_utils.c.
References TwmWindow::vs.
Referenced by AddIconManager(), AddWindow(), Animate(), CreateIconWindow(), f_showiconmgr_impl(), FindConstraint(), findWindowBox(), Iconify(), PaintAllDecoration(), RedoIcon(), RedoIconName(), RestoreWinConfig(), SetupFrame(), SetupOccupation(), WarpAlongRing(), and WarpToWindow().
| void WarpToWindow | ( | TwmWindow * | t, |
| bool | must_raise ) |
Definition at line 883 of file win_utils.c.
References TwmWindow::auto_raise, AutoRaiseWindow(), TwmWindow::_ring::curs_x, TwmWindow::_ring::curs_y, TwmWindow::_ring::cursor_valid, dpy, EventTime, TwmWindow::frame, TwmWindow::frame_bw, TwmWindow::frame_height, TwmWindow::frame_width, TwmWindow::frame_x, TwmWindow::frame_y, GotoWorkSpace(), WorkSpace::next, OCCUPY, TwmWindow::ring, Scr, SetFocus(), TwmWindow::title_height, visible(), x, and y.
Referenced by DeIconify(), EwmhClientMessage_NET_ACTIVE_WINDOW(), f_warpto_impl(), f_winwarp_impl(), GotoWorkSpace(), WarpAlongRing(), WMgrAddToCurrentWorkSpaceAndWarp(), and WMgrHandleButtonEvent().