1 |
// qsampler.cpp |
// qsampler.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2015, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2017, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, 2008 Christian Schoenebeck |
Copyright (C) 2007,2008,2015 Christian Schoenebeck |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
33 |
#include <QDir> |
#include <QDir> |
34 |
#endif |
#endif |
35 |
|
|
36 |
#define CONFIG_QUOTE1(x) #x |
#ifndef CONFIG_PREFIX |
37 |
#define CONFIG_QUOTED(x) CONFIG_QUOTE1(x) |
#define CONFIG_PREFIX "/usr/local" |
38 |
|
#endif |
39 |
|
|
40 |
#if defined(DATADIR) |
#ifndef CONFIG_DATADIR |
41 |
#define CONFIG_DATADIR CONFIG_QUOTED(DATADIR) |
#define CONFIG_DATADIR CONFIG_PREFIX "/share" |
|
#else |
|
|
#define CONFIG_DATADIR CONFIG_PREFIX "/share" |
|
42 |
#endif |
#endif |
43 |
|
|
44 |
#if WIN32 |
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) |
45 |
#define RELATIVE_LOCALE_DIR "/share/locale" |
#define RELATIVE_LOCALE_DIR "/share/locale" |
46 |
#elif defined(__APPLE__) |
#elif defined(__APPLE__) |
47 |
#define RELATIVE_LOCALE_DIR "/../Resources" |
#define RELATIVE_LOCALE_DIR "/../Resources" |
203 |
m_pWidget = pWidget; |
m_pWidget = pWidget; |
204 |
#ifdef CONFIG_X11 |
#ifdef CONFIG_X11 |
205 |
#ifdef CONFIG_XUNIQUE |
#ifdef CONFIG_XUNIQUE |
|
XGrabServer(m_pDisplay); |
|
206 |
m_wOwner = m_pWidget->winId(); |
m_wOwner = m_pWidget->winId(); |
207 |
XSetSelectionOwner(m_pDisplay, m_aUnique, m_wOwner, CurrentTime); |
if (m_pDisplay && m_wOwner) { |
208 |
XUngrabServer(m_pDisplay); |
XGrabServer(m_pDisplay); |
209 |
|
XSetSelectionOwner(m_pDisplay, m_aUnique, m_wOwner, CurrentTime); |
210 |
|
XUngrabServer(m_pDisplay); |
211 |
|
} |
212 |
#endif // CONFIG_XUNIQUE |
#endif // CONFIG_XUNIQUE |
213 |
#endif // CONFIG_X11 |
#endif // CONFIG_X11 |
214 |
} |
} |
221 |
{ |
{ |
222 |
#ifdef CONFIG_X11 |
#ifdef CONFIG_X11 |
223 |
#ifdef CONFIG_XUNIQUE |
#ifdef CONFIG_XUNIQUE |
224 |
if (m_wOwner != None) { |
if (m_pDisplay && m_wOwner != None) { |
225 |
// First, notify any freedesktop.org WM |
// First, notify any freedesktop.org WM |
226 |
// that we're about to show the main widget... |
// that we're about to show the main widget... |
227 |
Screen *pScreen = XDefaultScreenOfDisplay(m_pDisplay); |
Screen *pScreen = XDefaultScreenOfDisplay(m_pDisplay); |
266 |
#ifdef CONFIG_XUNIQUE |
#ifdef CONFIG_XUNIQUE |
267 |
void x11PropertyNotify(Window w) |
void x11PropertyNotify(Window w) |
268 |
{ |
{ |
269 |
if (m_pWidget && m_wOwner == w) { |
if (m_pDisplay && m_pWidget && m_wOwner == w) { |
270 |
// Always check whether our property-flag is still around... |
// Always check whether our property-flag is still around... |
271 |
Atom aType; |
Atom aType; |
272 |
int iFormat = 0; |
int iFormat = 0; |
507 |
|
|
508 |
|
|
509 |
// end of qsampler.cpp |
// end of qsampler.cpp |
510 |
|
|