JWM Source Documentation
Functions | Variables
client.c File Reference

Client window functions. More...

#include "jwm.h"
#include "client.h"
#include "clientlist.h"
#include "icon.h"
#include "group.h"
#include "tray.h"
#include "confirm.h"
#include "cursor.h"
#include "taskbar.h"
#include "screen.h"
#include "pager.h"
#include "color.h"
#include "place.h"
#include "event.h"
#include "settings.h"
#include "timing.h"
#include "grab.h"
#include "desktop.h"

Go to the source code of this file.

Functions

static void LoadFocus (void)
 Set the focus to the window currently under the mouse pointer.
 
static void RestackTransients (const ClientNode *np)
 Place transients on top of the owner.
 
static void MinimizeTransients (ClientNode *np, char lower)
 Minimize all transients as well as the specified client.
 
static void RestoreTransients (ClientNode *np, char raise)
 Restore a window with its transients (helper method).
 
static void KillClientHandler (ClientNode *np)
 Callback to kill a client after a confirm dialog.
 
static void UnmapClient (ClientNode *np)
 Unmap a client window and consume the UnmapNotify event.
 
void StartupClients (void)
 Load windows that are already mapped.
 
void ShutdownClients (void)
 Release client windows.
 
ClientNodeAddClientWindow (Window w, char alreadyMapped, char notOwner)
 Add a window to management.
 
void MinimizeClient (ClientNode *np, char lower)
 Minimize a client window and all of its transients.
 
void ShadeClient (ClientNode *np)
 Shade a client.
 
void UnshadeClient (ClientNode *np)
 Unshade a client.
 
void SetClientWithdrawn (ClientNode *np)
 Set a client's state to withdrawn.
 
void RestoreClient (ClientNode *np, char raise)
 Restore a client window and its transients.
 
void SetClientLayer (ClientNode *np, unsigned int layer)
 Set the client layer.
 
void SetClientSticky (ClientNode *np, char isSticky)
 Set a client's sticky status.
 
void SetClientDesktop (ClientNode *np, unsigned int desktop)
 Set a client's desktop.
 
void HideClient (ClientNode *np)
 Hide a client without unmapping.
 
void ShowClient (ClientNode *np)
 Show a hidden client.
 
void MaximizeClient (ClientNode *np, MaxFlags flags)
 Maximize a client window.
 
void MaximizeClientDefault (ClientNode *np)
 Maximize a client using its default maximize settings.
 
void SetClientFullScreen (ClientNode *np, char fullScreen)
 Set a client's full screen state.
 
void FocusClient (ClientNode *np)
 Set the active client.
 
void RefocusClient (void)
 Refocus the active client (if there is one).
 
void DeleteClient (ClientNode *np)
 Send a delete message to a client.
 
void KillClient (ClientNode *np)
 Kill a client window.
 
void RaiseClient (ClientNode *np)
 Raise the client.
 
void RestackClient (ClientNode *np, Window above, int detail)
 Restack a client window.
 
void RestackClients (void)
 Restack the clients according the way we want them.
 
void SendClientMessage (Window w, AtomType type, AtomType message)
 Send a client message to a window.
 
void RemoveClient (ClientNode *np)
 Remove a client window from management.
 
ClientNodeGetActiveClient (void)
 Get the active client (possibly NULL).
 
ClientNodeFindClient (Window w)
 Find a client by parent or window.
 
ClientNodeFindClientByWindow (Window w)
 Find a client by window.
 
ClientNodeFindClientByParent (Window p)
 Find a client by its frame window.
 
void ReparentClient (ClientNode *np)
 Reparent a client window.
 
void SendConfigureEvent (ClientNode *np)
 Send a configure event to a client window.
 
void UpdateClientColormap (ClientNode *np)
 Update a window's colormap.
 
void SignalUrgent (const TimeType *now, int x, int y, Window w, void *data)
 Update callback for clients with the urgency hint set.
 

Variables

static ClientNodeactiveClient
 
unsigned int clientCount
 The number of clients (maintained in client.c).
 

Detailed Description

Client window functions.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file client.c.

Function Documentation

ClientNode* AddClientWindow ( Window  w,
char  alreadyMapped,
char  notOwner 
)
void DeleteClient ( ClientNode np)
ClientNode* FindClient ( Window  w)

Find a client by parent or window.

Find a client by window or parent window.

Definition at line 1287 of file client.c.

References FindClientByParent(), and FindClientByWindow().

Referenced by ChooseWindow(), HandleEnterNotify(), and LoadFocus().

ClientNode* FindClientByParent ( Window  p)

Find a client by its frame window.

Find a client by its parent window.

Definition at line 1309 of file client.c.

References display, and frameContext.

Referenced by FindClient(), HandleButtonEvent(), HandleExpose(), and HandleMotionNotify().

ClientNode* FindClientByWindow ( Window  w)
void FocusClient ( ClientNode np)
ClientNode* GetActiveClient ( void  )

Get the active client (possibly NULL).

Get the active client.

Definition at line 1281 of file client.c.

References activeClient.

Referenced by HandleKeyPress().

void HideClient ( ClientNode np)

Hide a client without unmapping.

Hide a client.

This will not update transients.

Definition at line 636 of file client.c.

References display, JXUnmapWindow, ClientNode::parent, STAT_HIDDEN, STAT_MAPPED, STAT_SHADED, ClientNode::state, ClientState::status, and ClientNode::window.

Referenced by AddClientWindow(), ChangeDesktop(), and SetClientDesktop().

void KillClient ( ClientNode np)

Kill a client window.

Force a client to exit.

Definition at line 900 of file client.c.

References _, Assert, KillClientHandler(), and ShowConfirmDialog().

Referenced by DeleteClient(), and RunWindowCommand().

void KillClientHandler ( ClientNode np)
static

Callback to kill a client after a confirm dialog.

Definition at line 890 of file client.c.

References display, FocusNextStacked(), JXKillClient, and ClientNode::window.

Referenced by KillClient().

void LoadFocus ( void  )
static

Set the focus to the window currently under the mouse pointer.

Definition at line 96 of file client.c.

References display, FindClient(), FocusClient(), JXQueryPointer, and rootWindow.

Referenced by StartupClients().

void MaximizeClient ( ClientNode np,
MaxFlags  flags 
)
void MaximizeClientDefault ( ClientNode np)

Maximize a client using its default maximize settings.

Maximize a client using the default maximize settings.

Definition at line 720 of file client.c.

References Assert, ClientState::border, BORDER_MAX_H, BORDER_MAX_V, MAX_HORIZ, MAX_NONE, MAX_VERT, ClientState::maxFlags, MaximizeClient(), and ClientNode::state.

Referenced by DispatchBorderButtonEvent().

void MinimizeClient ( ClientNode np,
char  lower 
)
void MinimizeTransients ( ClientNode np,
char  lower 
)
static
void RaiseClient ( ClientNode np)

Raise the client.

Raise a client to the top of its layer.

This will affect transients.

Definition at line 947 of file client.c.

References Assert, ClientState::layer, ClientNode::next, nodes, nodeTail, ClientNode::prev, RequireRestack(), RestackTransients(), and ClientNode::state.

Referenced by AddClientWindow(), HandleButtonEvent(), HandleKeyPress(), HandleMapRequest(), MaximizeClient(), RestoreTransients(), and StopWindowWalk().

void RefocusClient ( void  )

Refocus the active client (if there is one).

Set the keyboard focus back to the active client.

Definition at line 870 of file client.c.

References FocusClient().

Referenced by ShowMenu(), and UnshadeClient().

void RemoveClient ( ClientNode np)
void ReparentClient ( ClientNode np)
void RestackClient ( ClientNode np,
Window  above,
int  detail 
)

Restack a client window.

Restack a client.

This will not affect transients.

Definition at line 975 of file client.c.

References ClientState::layer, ClientNode::next, nodes, nodeTail, ClientNode::prev, RequireRestack(), RestackTransients(), ClientNode::state, and ClientNode::window.

Referenced by HandleConfigureRequest(), and HandleNetRestack().

void RestackClients ( void  )
void RestackTransients ( const ClientNode np)
static

Place transients on top of the owner.

Definition at line 910 of file client.c.

References ClientState::layer, LAYER_COUNT, IconNode::next, ClientNode::next, nodes, nodeTail, ClientNode::owner, ClientNode::prev, ClientNode::state, and ClientNode::window.

Referenced by RaiseClient(), and RestackClient().

void RestoreClient ( ClientNode np,
char  raise 
)
void RestoreTransients ( ClientNode np,
char  raise 
)
static
void SendClientMessage ( Window  w,
AtomType  type,
AtomType  message 
)

Send a client message to a window.

Send a message to a client.

Definition at line 1163 of file client.c.

References atoms, Debug(), display, eventTime, JUNLIKELY, and JXSendEvent.

Referenced by DeleteClient(), Destroy(), and FocusClient().

void SendConfigureEvent ( ClientNode np)
void SetClientDesktop ( ClientNode np,
unsigned int  desktop 
)
void SetClientFullScreen ( ClientNode np,
char  fullScreen 
)
void SetClientLayer ( ClientNode np,
unsigned int  layer 
)

Set the client layer.

Set the layer of a client.

This will affect transients.

Definition at line 489 of file client.c.

References Assert, FIRST_LAYER, LAST_LAYER, ClientState::layer, IconNode::next, ClientNode::next, nodes, nodeTail, ClientNode::owner, ClientNode::prev, RequireRestack(), ClientNode::state, ClientNode::window, and WriteState().

Referenced by HandleNetWMState(), and RunWindowCommand().

void SetClientSticky ( ClientNode np,
char  isSticky 
)

Set a client's sticky status.

Set the sticky status of a client.

This will update transients.

Definition at line 545 of file client.c.

References Assert, ATOM_NET_WM_DESKTOP, currentDesktop, LAYER_COUNT, ClientNode::next, nodes, ClientNode::owner, SetCardinalAtom(), SetClientDesktop(), STAT_STICKY, ClientNode::state, ClientState::status, ClientNode::window, and WriteState().

Referenced by HandleClientMessage(), HandleKeyPress(), HandleNetWMState(), and RunWindowCommand().

void SetClientWithdrawn ( ClientNode np)
void ShadeClient ( ClientNode np)
void ShowClient ( ClientNode np)

Show a hidden client.

Show a client.

This will not update transients.

Definition at line 652 of file client.c.

References display, FocusClient(), JXMapWindow, ClientNode::parent, STAT_ACTIVE, STAT_HIDDEN, STAT_MAPPED, STAT_MINIMIZED, STAT_SHADED, ClientNode::state, ClientState::status, and ClientNode::window.

Referenced by ChangeDesktop(), and SetClientDesktop().

void ShutdownClients ( void  )

Release client windows.

Definition at line 82 of file client.c.

References LAYER_COUNT, nodeTail, and RemoveClient().

Referenced by Shutdown().

void SignalUrgent ( const TimeType now,
int  x,
int  y,
Window  w,
void *  data 
)

Update callback for clients with the urgency hint set.

Definition at line 1469 of file client.c.

References DrawBorder(), RequirePagerUpdate(), RequireTaskUpdate(), STAT_FLASH, STAT_NOTURGENT, ClientNode::state, and ClientState::status.

Referenced by AddClientWindow(), HandlePropertyNotify(), RemoveClient(), and UpdateState().

void StartupClients ( void  )

Load windows that are already mapped.

Definition at line 41 of file client.c.

References AddClientWindow(), clientCount, currentDesktop, display, JXFree, JXGetWindowAttributes, JXQueryTree, LAYER_COUNT, LoadFocus(), nodes, nodeTail, RequirePagerUpdate(), RequireTaskUpdate(), and rootWindow.

Referenced by Startup().

void UnmapClient ( ClientNode np)
static

Unmap a client window and consume the UnmapNotify event.

Definition at line 1487 of file client.c.

References display, JXUnmapWindow, STAT_MAPPED, ClientNode::state, ClientState::status, and ClientNode::window.

Referenced by MinimizeTransients(), SetClientWithdrawn(), and ShadeClient().

void UnshadeClient ( ClientNode np)
void UpdateClientColormap ( ClientNode np)

Update a window's colormap.

Update a client's colormap.

A call to this function indicates that the colormap(s) for the given client changed. This will change the active colormap(s) if the given client is active.

Definition at line 1438 of file client.c.

References Assert, ClientNode::cmap, ClientNode::colormaps, display, JXGetWindowAttributes, JXInstallColormap, ColormapNode::next, and ColormapNode::window.

Referenced by FocusClient(), HandleColormapChange(), and HandlePropertyNotify().

Variable Documentation

ClientNode* activeClient
static

Definition at line 29 of file client.c.

Referenced by GetActiveClient().

unsigned int clientCount

The number of clients (maintained in client.c).

Definition at line 31 of file client.c.

Referenced by AddClientWindow(), FocusGroup(), RemoveClient(), Render(), RestackClients(), StartupClients(), and UpdateNetClientList().

joewing.net / Projects / JWM