/[svn]/qsampler/trunk/src/qsampler.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsampler.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2839 by capela, Tue Aug 25 18:36:55 2015 UTC revision 3065 by capela, Mon Jan 2 12:11:50 2017 UTC
# Line 1  Line 1 
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
# Line 33  Line 33 
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 WIN32
# Line 204  public: Line 203  public:
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          }          }
# Line 220  public: Line 221  public:
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);
# Line 265  public: Line 266  public:
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;
# Line 506  int main ( int argc, char **argv ) Line 507  int main ( int argc, char **argv )
507    
508    
509  // end of qsampler.cpp  // end of qsampler.cpp
510    

Legend:
Removed from v.2839  
changed lines
  Added in v.3065

  ViewVC Help
Powered by ViewVC