Split source into multiple files
SIGUSR1 now causes reload of blacklist sigstoped now resumes all processes it stoped upon reciving SIGINT or SIGTERM sigstoped avoids stopping processes that have no top level window left TODO: is this enough?
This commit is contained in:
37
xinstance.h
Normal file
37
xinstance.h
Normal file
@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#include <X11/Xlib.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct Atoms
|
||||
{
|
||||
Atom netActiveWindow = 0;
|
||||
Atom netWmPid = 0;
|
||||
Atom wmClientMachine = 0;
|
||||
};
|
||||
|
||||
class XInstance
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
static constexpr unsigned long MAX_BYTES = 1048576;
|
||||
|
||||
Atoms atoms;
|
||||
int screen = 0;
|
||||
Display *display = nullptr;
|
||||
|
||||
private:
|
||||
|
||||
unsigned long readProparty(Window wid, Atom atom, unsigned char** prop, int* format);
|
||||
Atom getAtom(const std::string& atomName);
|
||||
|
||||
public:
|
||||
|
||||
~XInstance();
|
||||
bool open(const std::string& xDisplayName);
|
||||
Window getActiveWindow();
|
||||
pid_t getPid(Window wid);
|
||||
std::vector<Window> getTopLevelWindows();
|
||||
void flush();
|
||||
};
|
Reference in New Issue
Block a user