This repository has been archived by the owner on May 30, 2023. It is now read-only.
/
x11int.cpp
52 lines (44 loc) · 2.25 KB
/
x11int.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
x11int.cpp
Author:
Nikita Tsukanov <keks9n@gmail.com>
Copyright (c) 2011 Nikita Tsukanov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mainwindow.h"
#include "skypetab.h"
#include <dlfcn.h>
#include "x11.h"
#include <X11/Xlib.h>
using namespace skypetab;
typedef Window (*XCreateSimpleWindow_Proto)(Display *, Window, int, int, unsigned int, unsigned int, unsigned int, unsigned long, unsigned long);
XCreateSimpleWindow_Proto orig_XCreateSimpleWindow=(XCreateSimpleWindow_Proto)dlsym(RTLD_NEXT, "XCreateSimpleWindow");
extern "C" Window XCreateSimpleWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height,
unsigned int border_width, unsigned long border, unsigned long background)
{
X11::XDisplay=display;
Window np=skypetab::SkypeTab::onNewWindow();
if(np!=0)
parent=np;
return orig_XCreateSimpleWindow(display, parent, x, y, width, height, border_width, border, background);
}
typedef Window (*XCreateWindow_Proto)(Display *, Window, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, Visual *, unsigned long, XSetWindowAttributes *);
XCreateWindow_Proto orig_XCreateWindow=(XCreateWindow_Proto)dlsym(RTLD_NEXT,"XCreateWindow");
extern "C" Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int
_class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes)
{
X11::XDisplay=display;
Window np=skypetab::SkypeTab::onNewWindow();
if(np!=0)
parent=np;
return orig_XCreateWindow(display, parent, x, y, width, height, border_width, depth, _class, visual, valuemask, attributes);
}