Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-29 Thread Scott Kostyshak
On Fri, Jul 29, 2016 at 01:40:11AM +0200, Enrico Forestieri wrote:
> On Wed, Jul 27, 2016 at 10:45:10PM -0400, Scott Kostyshak wrote:
> > 
> > Enrico, have you seen the following?
> > https://codereview.qt-project.org/#/c/32263/
> > 
> > In particular, note the patch set here:
> > https://codereview.qt-project.org/#/c/32263/7//ALL
> > 
> > "Clients attempting to acquire a selection must set the time value of
> > the xcb_set_selection_owner request to the timestamp of the event
> > triggering the acquisition attempt, not to XCB_CURRENT_TIME."
> > 
> > Does this mean that setting to XCB_CURRENT_TIME in cb0c881b should be
> > changed to something else? I don't actually understand. I don't even
> > know if LyX is the "client" here (I would have guessed that "client"
> > referred to the application retrieving the selection, not writing it).
> > 
> > I have no idea if the above is relevant. Even if it is, if you don't
> > feel like spending more time on this, please don't. It is a minor issue
> > and you already committed a patch that works, so I doubt it is worth any
> > more of your time. I just send this to you in case it captures your
> > curiosity.
> 
> Before coming up with that patch I had tried setting the current timestamp
> but nothing happened (it didn't work). Then I tried setting the timestamp
> some seconds into the future and weird things occurred: LyX was the only
> application that could acquire ownership of the primary selection and all
> other applications were not able to select anything until the time elapsed.
> Then I used XCB_CURRENT_TIME and it worked flawlessly. I am really no
> expert in the innards of the X server, I simply see that it works.

Good to know. Well whatever you did works so thanks for figuring it out.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-28 Thread Enrico Forestieri
On Wed, Jul 27, 2016 at 10:45:10PM -0400, Scott Kostyshak wrote:
> 
> Enrico, have you seen the following?
> https://codereview.qt-project.org/#/c/32263/
> 
> In particular, note the patch set here:
> https://codereview.qt-project.org/#/c/32263/7//ALL
> 
> "Clients attempting to acquire a selection must set the time value of
> the xcb_set_selection_owner request to the timestamp of the event
> triggering the acquisition attempt, not to XCB_CURRENT_TIME."
> 
> Does this mean that setting to XCB_CURRENT_TIME in cb0c881b should be
> changed to something else? I don't actually understand. I don't even
> know if LyX is the "client" here (I would have guessed that "client"
> referred to the application retrieving the selection, not writing it).
> 
> I have no idea if the above is relevant. Even if it is, if you don't
> feel like spending more time on this, please don't. It is a minor issue
> and you already committed a patch that works, so I doubt it is worth any
> more of your time. I just send this to you in case it captures your
> curiosity.

Before coming up with that patch I had tried setting the current timestamp
but nothing happened (it didn't work). Then I tried setting the timestamp
some seconds into the future and weird things occurred: LyX was the only
application that could acquire ownership of the primary selection and all
other applications were not able to select anything until the time elapsed.
Then I used XCB_CURRENT_TIME and it worked flawlessly. I am really no
expert in the innards of the X server, I simply see that it works.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-27 Thread Scott Kostyshak
On Sun, Jul 10, 2016 at 11:45:42AM +0200, Enrico Forestieri wrote:

> I don't think that they are going to fix this issue that seems to be
> there since ages. I was not even aware of the problem and it is not
> even serious as giving focus to a window before pasting avoids it.
> Should they fix this issue, the patch itself would become redundant
> but not harmful, so it should be safe. On the other hand it is something
> that testifies the quality of a software, so I think it is worth
> committing with some explanatory comment.

Enrico, have you seen the following?
https://codereview.qt-project.org/#/c/32263/

In particular, note the patch set here:
https://codereview.qt-project.org/#/c/32263/7//ALL

"Clients attempting to acquire a selection must set the time value of
the xcb_set_selection_owner request to the timestamp of the event
triggering the acquisition attempt, not to XCB_CURRENT_TIME."

Does this mean that setting to XCB_CURRENT_TIME in cb0c881b should be
changed to something else? I don't actually understand. I don't even
know if LyX is the "client" here (I would have guessed that "client"
referred to the application retrieving the selection, not writing it).

I have no idea if the above is relevant. Even if it is, if you don't
feel like spending more time on this, please don't. It is a minor issue
and you already committed a patch that works, so I doubt it is worth any
more of your time. I just send this to you in case it captures your
curiosity.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-10 Thread Scott Kostyshak
On Sun, Jul 10, 2016 at 11:45:42AM +0200, Enrico Forestieri wrote:

> I don't think that they are going to fix this issue that seems to be
> there since ages. I was not even aware of the problem and it is not
> even serious as giving focus to a window before pasting avoids it.

True.

> Should they fix this issue, the patch itself would become redundant
> but not harmful, so it should be safe. On the other hand it is something
> that testifies the quality of a software, so I think it is worth
> committing with some explanatory comment.

OK thanks.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-10 Thread Enrico Forestieri
On Sun, Jul 10, 2016 at 01:15:06PM +0200, Enrico Forestieri wrote:

> On Sun, Jul 10, 2016 at 12:02:47PM +0200, Kornel Benko wrote:
> > Am Sonntag, 10. Juli 2016 um 11:53:37, schrieb Enrico Forestieri 
> > 
> > > 
> > > I suggest that I commit the previous patch you posted and then you
> > > can start from there.
> > 
> > Please no. I am convinced now that you were right about QPA_XCB, so I am not
> > happy to commit something which is worse than I already have.
> 
> Ok, I'll wait for your commit. Then, please, update and post the patch
> for cmake corresponding to the upcoming one from me, so that I can
> commit it altogether.

Actually, looking at your patch it is clear that this is what I was
asking for. So, I am going to incorporate it and commit.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-10 Thread Enrico Forestieri
On Sun, Jul 10, 2016 at 12:02:47PM +0200, Kornel Benko wrote:
> Am Sonntag, 10. Juli 2016 um 11:53:37, schrieb Enrico Forestieri 
> 
> > 
> > I suggest that I commit the previous patch you posted and then you
> > can start from there.
> 
> Please no. I am convinced now that you were right about QPA_XCB, so I am not
> happy to commit something which is worse than I already have.

Ok, I'll wait for your commit. Then, please, update and post the patch
for cmake corresponding to the upcoming one from me, so that I can
commit it altogether.

> > As regards the name of variables, I suggest
> > that you simply rename QT_USES_X11 as HAVE_QT5_X11_EXTRAS, because
> > that is what really that test is for. If you need to use QT_USES_X11
> > somewhere else, it should be set to true if QPA_XCB is true, because
> > that is what really guarantees that X11 is the default backend.
> 
> I need QT_USES_X11 for creation of xvkbd.
> In QT4 we use QT_USES_X11 too, so renaming is not so good idea.

There is a misunderstanding here. What I was suggesting is that, for Qt5,
instead of QT_USES_X11 == Qt5X11Extras_FOUND, it should be
QT_USES_X11 == QPA_XCB_FOUND.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-10 Thread Kornel Benko
Am Sonntag, 10. Juli 2016 um 11:53:37, schrieb Enrico Forestieri 

> On Sun, Jul 10, 2016 at 10:47:08AM +0200, Kornel Benko wrote:
> 
> > Am Samstag, 9. Juli 2016 um 21:26:51, schrieb Enrico Forestieri 
> > 
> > > A more safe approach is based on looking at QtCore/qconfig.h, which
> > > directly tells you what is the default backend. Indeed it contains
> > > #define QT_QPA_DEFAULT_PLATFORM_NAME "xcb"
> > > if X11 is the backend.
> > 
> > OK, next try.
> 
> I suggest that I commit the previous patch you posted and then you
> can start from there.

Please no. I am convinced now that you were right about QPA_XCB, so I am not 
happy to commit
something which is worse than I already have.

> As regards the name of variables, I suggest
> that you simply rename QT_USES_X11 as HAVE_QT5_X11_EXTRAS, because
> that is what really that test is for. If you need to use QT_USES_X11
> somewhere else, it should be set to true if QPA_XCB is true, because
> that is what really guarantees that X11 is the default backend.

I need QT_USES_X11 for creation of xvkbd.
In QT4 we use QT_USES_X11 too, so renaming is not so good idea.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-10 Thread Enrico Forestieri
On Sun, Jul 10, 2016 at 10:47:08AM +0200, Kornel Benko wrote:

> Am Samstag, 9. Juli 2016 um 21:26:51, schrieb Enrico Forestieri 
> 
> > A more safe approach is based on looking at QtCore/qconfig.h, which
> > directly tells you what is the default backend. Indeed it contains
> > #define QT_QPA_DEFAULT_PLATFORM_NAME "xcb"
> > if X11 is the backend.
> 
> OK, next try.

I suggest that I commit the previous patch you posted and then you
can start from there. As regards the name of variables, I suggest
that you simply rename QT_USES_X11 as HAVE_QT5_X11_EXTRAS, because
that is what really that test is for. If you need to use QT_USES_X11
somewhere else, it should be set to true if QPA_XCB is true, because
that is what really guarantees that X11 is the default backend.

> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 76cbdde..74d0ac8 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -925,11 +925,6 @@ endif()
>  include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake)
>  configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake 
> ${TOP_BINARY_DIR}/configCompiler.h)
>  
> -set(QPA_XCB)
> -if(Qt5X11Extras_FOUND AND QT_USES_X11)
> -  # QPA_XCB is only valid if QT5+X11
> -  set(QPA_XCB 1)
> -endif()
>  configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
>  
>  if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")
> diff --git a/development/cmake/ConfigureChecks.cmake 
> b/development/cmake/ConfigureChecks.cmake
> index 46d3f80..2d5c166 100644
> --- a/development/cmake/ConfigureChecks.cmake
> +++ b/development/cmake/ConfigureChecks.cmake
> @@ -12,6 +12,7 @@ include(CheckFunctionExists)
>  include(CheckLibraryExists)
>  include(CheckTypeSize)
>  include(CheckCXXSourceCompiles)
> +include(CheckCXXSourceRuns)
>  include(MacroBoolTo01)
>  include(TestBigEndian)
>  
> @@ -197,7 +198,30 @@ else()
>endif()
>  endif()
>  
> +set(QPA_XCB)
> +set(HAVE_QT5_X11_EXTRAS)
>  if(LYX_USE_QT MATCHES "QT5")
> +
> +  set(CMAKE_REQUIRED_INCLUDES ${Qt5Core_INCLUDE_DIRS})
> +  set(CMAKE_REQUIRED_FLAGS)
> +  #message(STATUS "Qt5Core_INCLUDE_DIRS = ${Qt5Core_INCLUDE_DIRS}")
> +  check_cxx_source_runs(
> +"
> +#include 
> +#include 
> +using namespace std;
> +string a(QT_QPA_DEFAULT_PLATFORM_NAME);
> +int main(int argc, char **argv)
> +{
> +  if (a.compare(\"xcb\") == 0)
> + return(0);
> +  else
> + return 1;
> +}
> +"
> +QT_XCB_FOUND)
> +set(QPA_XCB ${QT_XCB_FOUND})
> +
>if (Qt5X11Extras_FOUND)
>  get_target_property(_x11extra_prop Qt5::X11Extras 
> IMPORTED_CONFIGURATIONS)
>  get_target_property(_x11extra_link_libraries Qt5::X11Extras 
> IMPORTED_LOCATION_${_x11extra_prop})
> @@ -216,6 +240,7 @@ if(LYX_USE_QT MATCHES "QT5")
>  }
>  "
>  QT_USES_X11)
> +set(HAVE_QT5_X11_EXTRAS ${QT_USES_X11})
>endif()
>if (Qt5WinExtras_FOUND)
>  get_target_property(_winextra_prop Qt5::WinExtras 
> IMPORTED_CONFIGURATIONS)


-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-10 Thread Enrico Forestieri
On Sun, Jul 10, 2016 at 12:50:47AM -0400, Scott Kostyshak wrote:

> On Sat, Jul 09, 2016 at 06:36:36PM +0200, Enrico Forestieri wrote:
> 
> > I have also extended the fix to Qt4 in much the same manner and it works
> > for me. In the attached patch I have also incorporated the changes for
> > cmake, except for Qt4, as I don't know what is required.
> 
> I tested the new patch and it works well for me.

Thanks for testing.

> > The more I think about it, the more I am convinced that this is a Qt issue.
> 
> Should we put a fixme/todo somewhere to check if Qt fixes the issue in
> e.g. five years so we can remove the workaround? I do not mind if you do
> not want to commit the patch at all since your guess is that it's a Qt
> issue, and also because the commit is somewhat complicated. It's your
> call since I think you're the one who best understands the situation.

I don't think that they are going to fix this issue that seems to be
there since ages. I was not even aware of the problem and it is not
even serious as giving focus to a window before pasting avoids it.
Should they fix this issue, the patch itself would become redundant
but not harmful, so it should be safe. On the other hand it is something
that testifies the quality of a software, so I think it is worth
committing with some explanatory comment.
As regards the complication, well, it's only cmake that makes it
complicated for me ;)

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-10 Thread Kornel Benko
Am Samstag, 9. Juli 2016 um 21:26:51, schrieb Enrico Forestieri 
> A more safe approach is based on looking at QtCore/qconfig.h, which
> directly tells you what is the default backend. Indeed it contains
> #define QT_QPA_DEFAULT_PLATFORM_NAME "xcb"
> if X11 is the backend.

OK, next try.

Kornel

signature.asc
Description: This is a digitally signed message part.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76cbdde..74d0ac8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -925,11 +925,6 @@ endif()
 include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake)
 configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h)
 
-set(QPA_XCB)
-if(Qt5X11Extras_FOUND AND QT_USES_X11)
-  # QPA_XCB is only valid if QT5+X11
-  set(QPA_XCB 1)
-endif()
 configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
 
 if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")
diff --git a/development/cmake/ConfigureChecks.cmake b/development/cmake/ConfigureChecks.cmake
index 46d3f80..2d5c166 100644
--- a/development/cmake/ConfigureChecks.cmake
+++ b/development/cmake/ConfigureChecks.cmake
@@ -12,6 +12,7 @@ include(CheckFunctionExists)
 include(CheckLibraryExists)
 include(CheckTypeSize)
 include(CheckCXXSourceCompiles)
+include(CheckCXXSourceRuns)
 include(MacroBoolTo01)
 include(TestBigEndian)
 
@@ -197,7 +198,30 @@ else()
   endif()
 endif()
 
+set(QPA_XCB)
+set(HAVE_QT5_X11_EXTRAS)
 if(LYX_USE_QT MATCHES "QT5")
+
+  set(CMAKE_REQUIRED_INCLUDES ${Qt5Core_INCLUDE_DIRS})
+  set(CMAKE_REQUIRED_FLAGS)
+  #message(STATUS "Qt5Core_INCLUDE_DIRS = ${Qt5Core_INCLUDE_DIRS}")
+  check_cxx_source_runs(
+"
+#include 
+#include 
+using namespace std;
+string a(QT_QPA_DEFAULT_PLATFORM_NAME);
+int main(int argc, char **argv)
+{
+  if (a.compare(\"xcb\") == 0)
+	return(0);
+  else
+	return 1;
+}
+"
+QT_XCB_FOUND)
+set(QPA_XCB ${QT_XCB_FOUND})
+
   if (Qt5X11Extras_FOUND)
 get_target_property(_x11extra_prop Qt5::X11Extras IMPORTED_CONFIGURATIONS)
 get_target_property(_x11extra_link_libraries Qt5::X11Extras IMPORTED_LOCATION_${_x11extra_prop})
@@ -216,6 +240,7 @@ if(LYX_USE_QT MATCHES "QT5")
 }
 "
 QT_USES_X11)
+set(HAVE_QT5_X11_EXTRAS ${QT_USES_X11})
   endif()
   if (Qt5WinExtras_FOUND)
 get_target_property(_winextra_prop Qt5::WinExtras IMPORTED_CONFIGURATIONS)


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Scott Kostyshak
On Sat, Jul 09, 2016 at 06:36:36PM +0200, Enrico Forestieri wrote:

> I have also extended the fix to Qt4 in much the same manner and it works
> for me. In the attached patch I have also incorporated the changes for
> cmake, except for Qt4, as I don't know what is required.

I tested the new patch and it works well for me.

> The more I think about it, the more I am convinced that this is a Qt issue.

Should we put a fixme/todo somewhere to check if Qt fixes the issue in
e.g. five years so we can remove the workaround? I do not mind if you do
not want to commit the patch at all since your guess is that it's a Qt
issue, and also because the commit is somewhat complicated. It's your
call since I think you're the one who best understands the situation.

In any case, thanks for your work on this. I've learned something about
X events by trying (and failing) to debug this myself and then by
studying your patch.

> Clipboard managers are always troublesome. Cannot help here, sorry.

+1

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Kornel Benko
Am Samstag, 9. Juli 2016 um 21:26:51, schrieb Enrico Forestieri 
> On Sat, Jul 09, 2016 at 09:02:09PM +0200, Enrico Forestieri wrote:
> > 
> > Then, looking at development/cmake/ConfigureChecks.cmake, it seems to
> > me that QT_USES_X11 is correctly set for Qt4, because the QX11Info header
> > is always installed on all platforms and compilation fails if X11 is
> > not the correct backend. This is not true for Qt5, as QtX11Extras/QX11Info
> > is only present if the Qt5X11Extras module is installed, and not otherwise.
> > So, compilation of the code snippet at lines 212-216 may fail even if X11
> > is the backend, so that QT_USES_X11 may not be correctly guessed with Qt5.
> 
> Sorry, I now see that it is guarded by "if (Qt5X11Extras_FOUND)".
> In this case, the last sentence above should read:
> So, compilation of the code snippet at lines 212-216 is not attempted
> even if X11 is the backend, so that QT_USES_X11 may not be guessed with Qt5.
> 
> A more safe approach is based on looking at QtCore/qconfig.h, which
> directly tells you what is the default backend. Indeed it contains
> #define QT_QPA_DEFAULT_PLATFORM_NAME "xcb"
> if X11 is the backend.
> 

At the time I introduced the check, the need for knowing about X11 was testing 
with xvkbd.

I will try to use this define.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Kornel Benko
Am Samstag, 9. Juli 2016 um 21:02:09, schrieb Enrico Forestieri 
> On Sat, Jul 09, 2016 at 07:36:53PM +0200, Kornel Benko wrote:
> > Am Samstag, 9. Juli 2016 um 18:43:50, schrieb Enrico Forestieri 
> > 
> > > 
> > > Please, can you also check what has to be done for Qt4? The problem
> > > is that I have to use a X11 function and thus the X11 library should
> > > be added for the final link step, as already done for autotools.
> > 
> > Have I overseen  HAVE_QT4_X11_EXTRAS in your patch?
> 
> There is no Qt4X11Extras module.
> 
> > We check for  QX11Info in development/cmake/ConfigureChecks.cmake:231
> > The class QX11Info is only available if qt4 uses X11.
> > What more do you need?
> 
> That in the final link step -lX11 is added to the required libraries
> if Qt4 uses X11 as a backend.
> 
> Then, looking at development/cmake/ConfigureChecks.cmake, it seems to
> me that QT_USES_X11 is correctly set for Qt4, because the QX11Info header
> is always installed on all platforms and compilation fails if X11 is
> not the correct backend. This is not true for Qt5, as QtX11Extras/QX11Info
> is only present if the Qt5X11Extras module is installed, and not otherwise.
> So, compilation of the code snippet at lines 212-216 may fail even if X11
> is the backend, so that QT_USES_X11 may not be correctly guessed with Qt5.
> 

So what do you propose? The snipped 212-216 is compiled only if 
Qt5X11Extras_FOUND.

How else can we be sure about X11?

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Enrico Forestieri
On Sat, Jul 09, 2016 at 09:02:09PM +0200, Enrico Forestieri wrote:
> 
> Then, looking at development/cmake/ConfigureChecks.cmake, it seems to
> me that QT_USES_X11 is correctly set for Qt4, because the QX11Info header
> is always installed on all platforms and compilation fails if X11 is
> not the correct backend. This is not true for Qt5, as QtX11Extras/QX11Info
> is only present if the Qt5X11Extras module is installed, and not otherwise.
> So, compilation of the code snippet at lines 212-216 may fail even if X11
> is the backend, so that QT_USES_X11 may not be correctly guessed with Qt5.

Sorry, I now see that it is guarded by "if (Qt5X11Extras_FOUND)".
In this case, the last sentence above should read:
So, compilation of the code snippet at lines 212-216 is not attempted
even if X11 is the backend, so that QT_USES_X11 may not be guessed with Qt5.

A more safe approach is based on looking at QtCore/qconfig.h, which
directly tells you what is the default backend. Indeed it contains
#define QT_QPA_DEFAULT_PLATFORM_NAME "xcb"
if X11 is the backend.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Enrico Forestieri
On Sat, Jul 09, 2016 at 07:36:53PM +0200, Kornel Benko wrote:
> Am Samstag, 9. Juli 2016 um 18:43:50, schrieb Enrico Forestieri 
> 
> > 
> > Please, can you also check what has to be done for Qt4? The problem
> > is that I have to use a X11 function and thus the X11 library should
> > be added for the final link step, as already done for autotools.
> 
> Have I overseen  HAVE_QT4_X11_EXTRAS in your patch?

There is no Qt4X11Extras module.

> We check for  QX11Info in development/cmake/ConfigureChecks.cmake:231
> The class QX11Info is only available if qt4 uses X11.
> What more do you need?

That in the final link step -lX11 is added to the required libraries
if Qt4 uses X11 as a backend.

Then, looking at development/cmake/ConfigureChecks.cmake, it seems to
me that QT_USES_X11 is correctly set for Qt4, because the QX11Info header
is always installed on all platforms and compilation fails if X11 is
not the correct backend. This is not true for Qt5, as QtX11Extras/QX11Info
is only present if the Qt5X11Extras module is installed, and not otherwise.
So, compilation of the code snippet at lines 212-216 may fail even if X11
is the backend, so that QT_USES_X11 may not be correctly guessed with Qt5.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Kornel Benko
Am Samstag, 9. Juli 2016 um 18:43:50, schrieb Enrico Forestieri 
> On Sat, Jul 09, 2016 at 11:45:37AM +0200, Kornel Benko wrote:
> 
> > Am Samstag, 9. Juli 2016 um 04:09:30, schrieb Enrico Forestieri 
> > 
> > > I came up with the attached patch that solves the issue for me.
> > > It requires the Qt5X11Extras module, which is not mandatory, though.
> > > The patch simply tries to refresh the timestamp of the selection request.
> > > I still get the warning from Qt5 (even if only once), but the paste by the
> > > middle mouse button succeeds anyway. Recall that this issue does not occur
> > > with a focus-follows-mouse policy. Given that it also does not occur with
> > > some applications, I don't know who is to blame for this.
> > > 
> > > The patch is for Qt5 and autotools only (I don't know cmake, sorry).
> > > 
> > 
> > Attached.
> 
> Thanks, but...
> 
> > diff --git a/CMakeLists.txt b/CMakeLists.txt
> > index 76cbdde..e39fc59 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -929,6 +929,7 @@ set(QPA_XCB)
> >  if(Qt5X11Extras_FOUND AND QT_USES_X11)
> ># QPA_XCB is only valid if QT5+X11
> >set(QPA_XCB 1)
> > +  set(HAVE_QT5_X11_EXTRAS 1)
> >  endif()
> 
> This doesn't strike me as correct. QPA_XCB has to be set when Qt5
> uses X11, independently of the presence of the Qt5X11Extras module.
> In the patch I changed this to

I understand that. For me the presence of Qt5X11Extras-module was indication of 
X11.

> -if(Qt5X11Extras_FOUND AND QT_USES_X11)
> +if(LYX_USE_QT MATCHES "QT5" AND QT_USES_X11)
># QPA_XCB is only valid if QT5+X11
>set(QPA_XCB 1)
> +  if(Qt5X11Extras_FOUND)
> +set(HAVE_QT5_X11_EXTRAS 1)
> +  endif()
>  endif()
> 
> Please, can you also check what has to be done for Qt4? The problem
> is that I have to use a X11 function and thus the X11 library should
> be added for the final link step, as already done for autotools.

Have I overseen  HAVE_QT4_X11_EXTRAS in your patch?

We check for  QX11Info in development/cmake/ConfigureChecks.cmake:231
The class QX11Info is only available if qt4 uses X11.
What more do you need?

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Enrico Forestieri
On Sat, Jul 09, 2016 at 11:45:37AM +0200, Kornel Benko wrote:

> Am Samstag, 9. Juli 2016 um 04:09:30, schrieb Enrico Forestieri 
> 
> > I came up with the attached patch that solves the issue for me.
> > It requires the Qt5X11Extras module, which is not mandatory, though.
> > The patch simply tries to refresh the timestamp of the selection request.
> > I still get the warning from Qt5 (even if only once), but the paste by the
> > middle mouse button succeeds anyway. Recall that this issue does not occur
> > with a focus-follows-mouse policy. Given that it also does not occur with
> > some applications, I don't know who is to blame for this.
> > 
> > The patch is for Qt5 and autotools only (I don't know cmake, sorry).
> > 
> 
> Attached.

Thanks, but...

> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 76cbdde..e39fc59 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -929,6 +929,7 @@ set(QPA_XCB)
>  if(Qt5X11Extras_FOUND AND QT_USES_X11)
># QPA_XCB is only valid if QT5+X11
>set(QPA_XCB 1)
> +  set(HAVE_QT5_X11_EXTRAS 1)
>  endif()

This doesn't strike me as correct. QPA_XCB has to be set when Qt5
uses X11, independently of the presence of the Qt5X11Extras module.
In the patch I changed this to

-if(Qt5X11Extras_FOUND AND QT_USES_X11)
+if(LYX_USE_QT MATCHES "QT5" AND QT_USES_X11)
   # QPA_XCB is only valid if QT5+X11
   set(QPA_XCB 1)
+  if(Qt5X11Extras_FOUND)
+set(HAVE_QT5_X11_EXTRAS 1)
+  endif()
 endif()

Please, can you also check what has to be done for Qt4? The problem
is that I have to use a X11 function and thus the X11 library should
be added for the final link step, as already done for autotools.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Enrico Forestieri
On Sat, Jul 09, 2016 at 03:27:40AM -0400, Scott Kostyshak wrote:
> 
> I tried a few random variations on your patch to squash the last
> warning. One that worked for me is to add
> 
>   return true;
> 
> after
> 
>   xcb_flush(con);
> 
> I have no idea if that makes any sense but perhaps it provides a clue.
> Does the warning go away if you add that?

Yes, it does. The documentation is not so much clear about this. It says
"if you want to filter the message out, i.e. stop it being handled further,
return true; otherwise return false."
but it is not clear whether it refers to the *same* message or to the
same message type. Anyway, returning true has no ill effect and gets
rid of the warning (even compiling without Qt5X11Extras), so I added it.
Thanks for the tip.

I have also extended the fix to Qt4 in much the same manner and it works
for me. In the attached patch I have also incorporated the changes for
cmake, except for Qt4, as I don't know what is required.
The more I think about it, the more I am convinced that this is a Qt issue.

> Finally, this doesn't seem to solve the flood of messages I get when
> CopyQ is running, but I don't think this is worth investigating.

Clipboard managers are always troublesome. Cannot help here, sorry.

-- 
Enrico
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76cbdde..7e13427 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -926,9 +926,12 @@ include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake)
 configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake 
${TOP_BINARY_DIR}/configCompiler.h)
 
 set(QPA_XCB)
-if(Qt5X11Extras_FOUND AND QT_USES_X11)
+if(LYX_USE_QT MATCHES "QT5" AND QT_USES_X11)
   # QPA_XCB is only valid if QT5+X11
   set(QPA_XCB 1)
+  if(Qt5X11Extras_FOUND)
+set(HAVE_QT5_X11_EXTRAS 1)
+  endif()
 endif()
 configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
 
diff --git a/config/qt4.m4 b/config/qt4.m4
index 0e357a4..f39c0ed 100644
--- a/config/qt4.m4
+++ b/config/qt4.m4
@@ -172,18 +172,30 @@ AC_DEFUN([QT_DO_IT_ALL],
[AC_MSG_ERROR([LyX requires at least version $1 of Qt. Only version 
$QTLIB_VERSION has been found.])
])
 
+   save_CPPFLAGS=$CPPFLAGS
+   AC_MSG_CHECKING([whether Qt uses the X Window system])
+   CPPFLAGS="$save_CPPFLAGS $QT_CORE_INCLUDES"
if test x$USE_QT5 = xyes ; then
- save_CPPFLAGS=$CPPFLAGS
- AC_MSG_CHECKING([whether Qt uses the X Window system])
- CPPFLAGS="$save_CPPFLAGS $QT_CORE_INCLUDES"
  AC_EGREP_CPP(xcb,
[#include 
QT_QPA_DEFAULT_PLATFORM_NAME],
[AC_MSG_RESULT(yes)
 AC_DEFINE(QPA_XCB, 1, [Define if Qt uses the X Window System])],
[AC_MSG_RESULT(no)])
- CPPFLAGS=$save_CPPFLAGS
+   else
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE([
+   [#include ],
+   [#ifndef Q_WS_X11],
+   [#error Fail],
+   [#endif]])],
+   qt_use_x11=yes,
+   qt_use_x11=no)
+ AC_MSG_RESULT($qt_use_x11)
+ if test "x$qt_use_x11" = "xyes"; then
+   QT_LIB="$QT_LIB -lX11"
+ fi
fi
+   CPPFLAGS=$save_CPPFLAGS
 
QT_FIND_TOOL([QT_MOC], [moc])
QT_FIND_TOOL([QT_UIC], [uic])
@@ -209,6 +221,13 @@ AC_DEFUN([QT_DO_PKG_CONFIG],
if test "x$USE_QT5" != "xno" ; then
qt_corelibs="Qt5Core"
qt_guilibs="Qt5Core Qt5Concurrent Qt5Gui Qt5Svg Qt5Widgets"
+   lyx_use_x11extras=false
+   PKG_CHECK_EXISTS(Qt5X11Extras, [lyx_use_x11extras=true], [])
+   if $lyx_use_x11extras; then
+   qt_guilibs="$qt_guilibs Qt5X11Extras xcb"
+   AC_DEFINE(HAVE_QT5_X11_EXTRAS, 1,
+   [Define if you have the Qt5X11Extras module])
+   fi
lyx_use_winextras=false
PKG_CHECK_EXISTS(Qt5WinExtras, [lyx_use_winextras=true], [])
if $lyx_use_winextras; then
diff --git a/development/cmake/config.h.cmake b/development/cmake/config.h.cmake
index 253d39f..95148b6 100644
--- a/development/cmake/config.h.cmake
+++ b/development/cmake/config.h.cmake
@@ -73,6 +73,9 @@
 // Defined if QT=QT5 uses X11
 #cmakedefine QPA_XCB 1
 
+// Define if you have the Qt5X11Extras module
+#cmakedefine HAVE_QT5_X11_EXTRAS 1
+
 ${Include_used_spellchecker}
 
 #cmakedefine AIKSAURUSLIB_FOUND 1
diff --git a/src/frontends/qt4/GuiApplication.cpp 
b/src/frontends/qt4/GuiApplication.cpp
index 6586207..6f48ed0 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -121,10 +121,14 @@
 #ifdef Q_WS_X11
 #include 
 #include 
+#include 
 #undef CursorShape
 #undef None
 #elif defined(QPA_XCB)
 #include 
+#ifdef HAVE_QT5_X11_EXTRAS
+#include 
+#endif
 #endif
 
 #if (QT_VERSION < 0x05) || (QT_VERSION >= 0x050400)
@@ -3130,8 +3134,21 @@ bool GuiApplication::x11EventFilter(XEvent * xev)
BufferView * bv = 

Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Kornel Benko
Am Samstag, 9. Juli 2016 um 04:09:30, schrieb Enrico Forestieri 
> I came up with the attached patch that solves the issue for me.
> It requires the Qt5X11Extras module, which is not mandatory, though.
> The patch simply tries to refresh the timestamp of the selection request.
> I still get the warning from Qt5 (even if only once), but the paste by the
> middle mouse button succeeds anyway. Recall that this issue does not occur
> with a focus-follows-mouse policy. Given that it also does not occur with
> some applications, I don't know who is to blame for this.
>
> The patch is for Qt5 and autotools only (I don't know cmake, sorry).
>

Attached.

Kornel

signature.asc
Description: This is a digitally signed message part.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76cbdde..e39fc59 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -929,6 +929,7 @@ set(QPA_XCB)
 if(Qt5X11Extras_FOUND AND QT_USES_X11)
   # QPA_XCB is only valid if QT5+X11
   set(QPA_XCB 1)
+  set(HAVE_QT5_X11_EXTRAS 1)
 endif()
 configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
 
diff --git a/development/cmake/config.h.cmake b/development/cmake/config.h.cmake
index 253d39f..95148b6 100644
--- a/development/cmake/config.h.cmake
+++ b/development/cmake/config.h.cmake
@@ -73,6 +73,9 @@
 // Defined if QT=QT5 uses X11
 #cmakedefine QPA_XCB 1
 
+// Define if you have the Qt5X11Extras module
+#cmakedefine HAVE_QT5_X11_EXTRAS 1
+
 ${Include_used_spellchecker}
 
 #cmakedefine AIKSAURUSLIB_FOUND 1


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-09 Thread Scott Kostyshak
On Sat, Jul 09, 2016 at 04:09:30AM +0200, Enrico Forestieri wrote:
> 
> I had a closer look at this issue. First of all, it occurs with both
> Qt4 and Qt5, the only difference being that Qt5 prints a warning.
> Then, it does not occur with all applications. I can reproduce with
> gnome-terminal and gedit, but cannot reproduce with gvim, for example.
> It only occurs after selecting something in lyx and trying to paste to
> another application for the first time. Then the paste succeeds on a
> second attempt, even if the window has not the focus anymore. However,
> selecting something else in lyx, it starts over again.

I see similar behavior.

> I came up with the attached patch that solves the issue for me.

Thanks for working on this.

> It requires the Qt5X11Extras module, which is not mandatory, though.
> The patch simply tries to refresh the timestamp of the selection request.
> I still get the warning from Qt5 (even if only once), but the paste by the
> middle mouse button succeeds anyway. Recall that this issue does not occur
> with a focus-follows-mouse policy. Given that it also does not occur with
> some applications, I don't know who is to blame for this.

I tested the patch and can reproduce your findings. The first paste now
works. As you mentioned, I still get the warning, but only one warning
where without the patch I get three warnings.

I tried a few random variations on your patch to squash the last
warning. One that worked for me is to add

  return true;

after

  xcb_flush(con);

I have no idea if that makes any sense but perhaps it provides a clue.
Does the warning go away if you add that?

Finally, this doesn't seem to solve the flood of messages I get when
CopyQ is running, but I don't think this is worth investigating.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-08 Thread Enrico Forestieri
On Mon, Jun 27, 2016 at 12:08:43AM +0200, Enrico Forestieri wrote:

> On Sun, Jun 26, 2016 at 11:33:53PM +0200, Enrico Forestieri wrote:
> 
> > On Sun, Jun 26, 2016 at 02:50:28PM -0400, Scott Kostyshak wrote:
> > 
> > > On Sun, Jun 26, 2016 at 01:51:58PM +0200, Enrico Forestieri wrote:
> > > 
> > > > > Can anyone else reproduce?
> > > > 
> > > > I cannot. It works for me even compiling lyx as an X11 application
> > > > on cygwin (using Qt5) and middle-pasting to native windows applications
> > > > that support it, such as gvim.
> > > 
> > > OK so it might be specific to X11 on Linux.
> > 
> > Actually, I don't see it neither on linux nor on solaris. Maybe it is
> > due to the fact that I use a focus-follows-mouse policy.
> 
> Yes, that was it. After I change to focus-click the first middle click
> does not paste anything but simply gives focus to the window and the
> message you reported earlier is printed in the terminal from which lyx
> was started. Still, this doesn't happen on cygwin and I have no idea
> why it happens, yet.

I had a closer look at this issue. First of all, it occurs with both
Qt4 and Qt5, the only difference being that Qt5 prints a warning.
Then, it does not occur with all applications. I can reproduce with
gnome-terminal and gedit, but cannot reproduce with gvim, for example.
It only occurs after selecting something in lyx and trying to paste to
another application for the first time. Then the paste succeeds on a
second attempt, even if the window has not the focus anymore. However,
selecting something else in lyx, it starts over again.

I came up with the attached patch that solves the issue for me.
It requires the Qt5X11Extras module, which is not mandatory, though.
The patch simply tries to refresh the timestamp of the selection request.
I still get the warning from Qt5 (even if only once), but the paste by the
middle mouse button succeeds anyway. Recall that this issue does not occur
with a focus-follows-mouse policy. Given that it also does not occur with
some applications, I don't know who is to blame for this.

The patch is for Qt5 and autotools only (I don't know cmake, sorry).

-- 
Enrico
diff --git a/config/qt4.m4 b/config/qt4.m4
index 0e357a4..5d0a306 100644
--- a/config/qt4.m4
+++ b/config/qt4.m4
@@ -209,6 +209,13 @@ AC_DEFUN([QT_DO_PKG_CONFIG],
 	if test "x$USE_QT5" != "xno" ; then
 		qt_corelibs="Qt5Core"
 		qt_guilibs="Qt5Core Qt5Concurrent Qt5Gui Qt5Svg Qt5Widgets"
+		lyx_use_x11extras=false
+		PKG_CHECK_EXISTS(Qt5X11Extras, [lyx_use_x11extras=true], [])
+		if $lyx_use_x11extras; then
+			qt_guilibs="$qt_guilibs Qt5X11Extras xcb"
+			AC_DEFINE(HAVE_QT5_X11_EXTRAS, 1,
+[Define if you have the Qt5X11Extras module])
+		fi
 		lyx_use_winextras=false
 		PKG_CHECK_EXISTS(Qt5WinExtras, [lyx_use_winextras=true], [])
 		if $lyx_use_winextras; then
diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp
index 6586207..d1541cf 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -125,6 +125,9 @@
 #undef None
 #elif defined(QPA_XCB)
 #include 
+#ifdef HAVE_QT5_X11_EXTRAS
+#include 
+#endif
 #endif
 
 #if (QT_VERSION < 0x05) || (QT_VERSION >= 0x050400)
@@ -3166,8 +3169,23 @@ bool GuiApplication::nativeEventFilter(const QByteArray & eventType,
 		BufferView * bv = current_view_->currentBufferView();
 		if (bv) {
 			docstring const sel = bv->requestSelection();
-			if (!sel.empty())
+			if (!sel.empty()) {
 d->selection_.put(sel);
+#ifdef HAVE_QT5_X11_EXTRAS
+xcb_selection_notify_event_t nev;
+nev.response_type = XCB_SELECTION_NOTIFY;
+nev.requestor = srev->requestor;
+nev.selection = srev->selection;
+nev.target = srev->target;
+nev.property = XCB_NONE;
+nev.time = XCB_CURRENT_TIME;
+xcb_connection_t * con = QX11Info::connection();
+xcb_send_event(con, 0, srev->requestor,
+	XCB_EVENT_MASK_NO_EVENT,
+	reinterpret_cast());
+xcb_flush(con);
+#endif
+			}
 		}
 		break;
 	}


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-08 Thread Scott Kostyshak
On Fri, Jul 08, 2016 at 11:20:24AM +0200, Jürgen Spitzmüller wrote:
> Am Freitag, den 08.07.2016, 05:15 -0400 schrieb Scott Kostyshak:
> > Jürgen can you reproduce now with the steps above?
> 
> Yes. But I have no idea how to fix it.

OK. Thanks for taking a look.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-08 Thread Jürgen Spitzmüller
Am Freitag, den 08.07.2016, 05:15 -0400 schrieb Scott Kostyshak:
> Jürgen can you reproduce now with the steps above?

Yes. But I have no idea how to fix it.

Jürgen


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-07-08 Thread Scott Kostyshak
On Sat, Jun 25, 2016 at 11:56:40PM -0400, Scott Kostyshak wrote:
> On Sat, Jun 25, 2016 at 10:05:47AM +0200, Jürgen Spitzmüller wrote:
> > Am Donnerstag, den 23.06.2016, 21:43 -0400 schrieb Scott Kostyshak:
> > > Jürgen, any idea?
> > 
> > No.
> 
> OK I found a simple way to reproduce:
> 
> 1. Open gedit (I don't think the application matters, I also tested with
> gnome-terminal) on the left side of the screen.
> 2. Open LyX on the right-side of the screen.
> 3. Select something in LyX.
> 4. Do a middle-click on the gedit window.
> 
> The message is shown in the terminal three times and nothing is actually
> pasted into the gedit window.
> 
> Important: I cannot reproduce if between 3 and 4 I first do a left-click
> on the gedit window.
> 
> When I try to middle-click from other applications, I do not see this
> behavior: a middle-click pastes correctly regardless of whether the
> target window has the focus.
> 
> Can anyone else reproduce?
> 
> Scott

Jürgen can you reproduce now with the steps above?

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-27 Thread Kornel Benko
Am Sonntag, 26. Juni 2016 um 18:11:20, schrieb Scott Kostyshak 

> On Sun, Jun 26, 2016 at 11:33:53PM +0200, Enrico Forestieri wrote:
> > On Sun, Jun 26, 2016 at 02:50:28PM -0400, Scott Kostyshak wrote:
> > 
> > > On Sun, Jun 26, 2016 at 01:51:58PM +0200, Enrico Forestieri wrote:
> > > 
> > > > > Can anyone else reproduce?
> > > > 
> > > > I cannot. It works for me even compiling lyx as an X11 application
> > > > on cygwin (using Qt5) and middle-pasting to native windows applications
> > > > that support it, such as gvim.
> > > 
> > > OK so it might be specific to X11 on Linux.
> > 
> > Actually, I don't see it neither on linux nor on solaris. Maybe it is
> > due to the fact that I use a focus-follows-mouse policy.
> 
> Ah yes that could be the reason.
> 
> Scott

I see it too. In 'vi' and also in terminal-window (checked with 'konsole' and 
'mate-terminal').
But not in 'gvim' or 'kmail'.

Kornel


signature.asc
Description: This is a digitally signed message part.


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-27 Thread Jean-Pierre Chrétien

Le 26/06/2016 04:56, Scott Kostyshak a écrit :



Can anyone else reproduce?

Scott



Yes on Debian Jessie :

LyX 2.2.1dev (not released yet)
Empreinte de validation Git d9550acd
Configuration
  Host type:   x86_64-unknown-linux-gnu
  Special build flags:  build=development warnings assertions stdlib-debug 
c++11 std-regex use-hunspell

  C++ Compiler:g++ (4.9.2)
  C++ Compiler flags:   -Wall -Wextra -std=c++11 -g -O 
-Wno-deprecated-declarations

  C++ Compiler user flags:
  Linker flags:
  Linker user flags:
  Qt Frontend:
  Qt version:  4.8.6
  Packaging:   posix
  LyX binary dir:  /usr/local/bin
  LyX files dir:   /usr/local/share/lyx-2.2.1dev

But I do not get any message in the command window from which I called gedit and 
LyX: paste do not work, simply.


--
Jean-Pierre


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-26 Thread Scott Kostyshak
On Sun, Jun 26, 2016 at 11:33:53PM +0200, Enrico Forestieri wrote:
> On Sun, Jun 26, 2016 at 02:50:28PM -0400, Scott Kostyshak wrote:
> 
> > On Sun, Jun 26, 2016 at 01:51:58PM +0200, Enrico Forestieri wrote:
> > 
> > > > Can anyone else reproduce?
> > > 
> > > I cannot. It works for me even compiling lyx as an X11 application
> > > on cygwin (using Qt5) and middle-pasting to native windows applications
> > > that support it, such as gvim.
> > 
> > OK so it might be specific to X11 on Linux.
> 
> Actually, I don't see it neither on linux nor on solaris. Maybe it is
> due to the fact that I use a focus-follows-mouse policy.

Ah yes that could be the reason.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-26 Thread Enrico Forestieri
On Sun, Jun 26, 2016 at 11:33:53PM +0200, Enrico Forestieri wrote:

> On Sun, Jun 26, 2016 at 02:50:28PM -0400, Scott Kostyshak wrote:
> 
> > On Sun, Jun 26, 2016 at 01:51:58PM +0200, Enrico Forestieri wrote:
> > 
> > > > Can anyone else reproduce?
> > > 
> > > I cannot. It works for me even compiling lyx as an X11 application
> > > on cygwin (using Qt5) and middle-pasting to native windows applications
> > > that support it, such as gvim.
> > 
> > OK so it might be specific to X11 on Linux.
> 
> Actually, I don't see it neither on linux nor on solaris. Maybe it is
> due to the fact that I use a focus-follows-mouse policy.

Yes, that was it. After I change to focus-click the first middle click
does not paste anything but simply gives focus to the window and the
message you reported earlier is printed in the terminal from which lyx
was started. Still, this doesn't happen on cygwin and I have no idea
why it happens, yet.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-26 Thread Enrico Forestieri
On Sun, Jun 26, 2016 at 02:50:28PM -0400, Scott Kostyshak wrote:

> On Sun, Jun 26, 2016 at 01:51:58PM +0200, Enrico Forestieri wrote:
> 
> > > Can anyone else reproduce?
> > 
> > I cannot. It works for me even compiling lyx as an X11 application
> > on cygwin (using Qt5) and middle-pasting to native windows applications
> > that support it, such as gvim.
> 
> OK so it might be specific to X11 on Linux.

Actually, I don't see it neither on linux nor on solaris. Maybe it is
due to the fact that I use a focus-follows-mouse policy.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-26 Thread Scott Kostyshak
On Sun, Jun 26, 2016 at 02:32:03PM +0100, Guillaume Munch wrote:
> Le 26/06/2016 04:56, Scott Kostyshak a écrit :
> > Can anyone else reproduce?
> > 
> 
> I can.

Good to know, thanks for checking.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-26 Thread Scott Kostyshak
On Sun, Jun 26, 2016 at 01:51:58PM +0200, Enrico Forestieri wrote:

> > Can anyone else reproduce?
> 
> I cannot. It works for me even compiling lyx as an X11 application
> on cygwin (using Qt5) and middle-pasting to native windows applications
> that support it, such as gvim.

OK so it might be specific to X11 on Linux.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-26 Thread Guillaume Munch

Le 26/06/2016 04:56, Scott Kostyshak a écrit :

Can anyone else reproduce?



I can.




Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-26 Thread Enrico Forestieri
On Sat, Jun 25, 2016 at 11:56:40PM -0400, Scott Kostyshak wrote:
> 
> OK I found a simple way to reproduce:
> 
> 1. Open gedit (I don't think the application matters, I also tested with
> gnome-terminal) on the left side of the screen.
> 2. Open LyX on the right-side of the screen.
> 3. Select something in LyX.
> 4. Do a middle-click on the gedit window.
> 
> The message is shown in the terminal three times and nothing is actually
> pasted into the gedit window.
> 
> Important: I cannot reproduce if between 3 and 4 I first do a left-click
> on the gedit window.
> 
> When I try to middle-click from other applications, I do not see this
> behavior: a middle-click pastes correctly regardless of whether the
> target window has the focus.
> 
> Can anyone else reproduce?

I cannot. It works for me even compiling lyx as an X11 application
on cygwin (using Qt5) and middle-pasting to native windows applications
that support it, such as gvim.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-25 Thread Scott Kostyshak
On Sat, Jun 25, 2016 at 10:05:47AM +0200, Jürgen Spitzmüller wrote:
> Am Donnerstag, den 23.06.2016, 21:43 -0400 schrieb Scott Kostyshak:
> > Jürgen, any idea?
> 
> No.

OK I found a simple way to reproduce:

1. Open gedit (I don't think the application matters, I also tested with
gnome-terminal) on the left side of the screen.
2. Open LyX on the right-side of the screen.
3. Select something in LyX.
4. Do a middle-click on the gedit window.

The message is shown in the terminal three times and nothing is actually
pasted into the gedit window.

Important: I cannot reproduce if between 3 and 4 I first do a left-click
on the gedit window.

When I try to middle-click from other applications, I do not see this
behavior: a middle-click pastes correctly regardless of whether the
target window has the focus.

Can anyone else reproduce?

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-25 Thread Jürgen Spitzmüller
Am Donnerstag, den 23.06.2016, 21:43 -0400 schrieb Scott Kostyshak:
> Jürgen, any idea?

No.

Jürgen


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-23 Thread Scott Kostyshak
On Mon, Jun 13, 2016 at 10:20:04AM +0200, Enrico Forestieri wrote:
> On Mon, Jun 13, 2016 at 02:06:34AM -0400, Scott Kostyshak wrote:
> 
> > On Tue, Jun 07, 2016 at 03:48:18PM -0400, Scott Kostyshak wrote:
> > > On Tue, Jun 07, 2016 at 04:20:49PM +0200, Kornel Benko wrote:
> > > > Am Sonntag, 5. Juni 2016 um 21:28:06, schrieb Scott Kostyshak 
> > > > 
> > > > > Does anyone else often get these annoying messages when running LyX 
> > > > > from
> > > > > a terminal?
> > > > > 
> > > > > QXcbClipboard: SelectionRequest too old
> > > > > 
> > > > > I've been getting them for a while. I wonder if it is something
> > > > > particular to my system (e.g. because of the clipboard manager I use,
> > > > > CopyQ).
> > > > > 
> > > > > Scott
> > > > 
> > > > How do you trigger this output?
> > > 
> > > I cannot find a reproducible way to trigger it. I have not looked at it
> > > in detail actually. When it does appear, it often comes in bunches. I
> > > first wanted to check to see if others see it. It sounds like I am the
> > > only one, which makes me suspect it is indeed my clipboard manager.
> > 
> > To reproduce with CopyQ running:
> > start LyX, start a new document, type "abc" then press shift+left to
> > highlight "c". Upon release of shift, the messages come.
> > 
> > If I remove the code
> > 
> > #ifdef QPA_XCB
> >// Enable reception of XCB events.
> >installNativeEventFilter(this);
> > #endif
> > 
> > in GuiApplication.cpp, I no longer get the messages.
> > The event filter was introduced at 52fee355.
> > 
> > Enrico or Jürgen, do you have any idea?
> 
> Sorry, but I have no idea.

Jürgen, any idea?

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-13 Thread Enrico Forestieri
On Mon, Jun 13, 2016 at 02:06:34AM -0400, Scott Kostyshak wrote:

> On Tue, Jun 07, 2016 at 03:48:18PM -0400, Scott Kostyshak wrote:
> > On Tue, Jun 07, 2016 at 04:20:49PM +0200, Kornel Benko wrote:
> > > Am Sonntag, 5. Juni 2016 um 21:28:06, schrieb Scott Kostyshak 
> > > 
> > > > Does anyone else often get these annoying messages when running LyX from
> > > > a terminal?
> > > > 
> > > > QXcbClipboard: SelectionRequest too old
> > > > 
> > > > I've been getting them for a while. I wonder if it is something
> > > > particular to my system (e.g. because of the clipboard manager I use,
> > > > CopyQ).
> > > > 
> > > > Scott
> > > 
> > > How do you trigger this output?
> > 
> > I cannot find a reproducible way to trigger it. I have not looked at it
> > in detail actually. When it does appear, it often comes in bunches. I
> > first wanted to check to see if others see it. It sounds like I am the
> > only one, which makes me suspect it is indeed my clipboard manager.
> 
> To reproduce with CopyQ running:
> start LyX, start a new document, type "abc" then press shift+left to
> highlight "c". Upon release of shift, the messages come.
> 
> If I remove the code
> 
> #ifdef QPA_XCB
>// Enable reception of XCB events.
>installNativeEventFilter(this);
> #endif
> 
> in GuiApplication.cpp, I no longer get the messages.
> The event filter was introduced at 52fee355.
> 
> Enrico or Jürgen, do you have any idea?

Sorry, but I have no idea.

-- 
Enrico


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-13 Thread Scott Kostyshak
On Tue, Jun 07, 2016 at 03:48:18PM -0400, Scott Kostyshak wrote:
> On Tue, Jun 07, 2016 at 04:20:49PM +0200, Kornel Benko wrote:
> > Am Sonntag, 5. Juni 2016 um 21:28:06, schrieb Scott Kostyshak 
> > 
> > > Does anyone else often get these annoying messages when running LyX from
> > > a terminal?
> > > 
> > > QXcbClipboard: SelectionRequest too old
> > > 
> > > I've been getting them for a while. I wonder if it is something
> > > particular to my system (e.g. because of the clipboard manager I use,
> > > CopyQ).
> > > 
> > > Scott
> > 
> > How do you trigger this output?
> 
> I cannot find a reproducible way to trigger it. I have not looked at it
> in detail actually. When it does appear, it often comes in bunches. I
> first wanted to check to see if others see it. It sounds like I am the
> only one, which makes me suspect it is indeed my clipboard manager.

To reproduce with CopyQ running:
start LyX, start a new document, type "abc" then press shift+left to
highlight "c". Upon release of shift, the messages come.

If I remove the code

#ifdef QPA_XCB
   // Enable reception of XCB events.
   installNativeEventFilter(this);
#endif

in GuiApplication.cpp, I no longer get the messages.
The event filter was introduced at 52fee355.

Enrico or Jürgen, do you have any idea?

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-07 Thread Scott Kostyshak
On Tue, Jun 07, 2016 at 04:20:49PM +0200, Kornel Benko wrote:
> Am Sonntag, 5. Juni 2016 um 21:28:06, schrieb Scott Kostyshak 
> 
> > Does anyone else often get these annoying messages when running LyX from
> > a terminal?
> > 
> > QXcbClipboard: SelectionRequest too old
> > 
> > I've been getting them for a while. I wonder if it is something
> > particular to my system (e.g. because of the clipboard manager I use,
> > CopyQ).
> > 
> > Scott
> 
> How do you trigger this output?

I cannot find a reproducible way to trigger it. I have not looked at it
in detail actually. When it does appear, it often comes in bunches. I
first wanted to check to see if others see it. It sounds like I am the
only one, which makes me suspect it is indeed my clipboard manager.

Scott


signature.asc
Description: PGP signature


Re: Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-07 Thread Kornel Benko
Am Sonntag, 5. Juni 2016 um 21:28:06, schrieb Scott Kostyshak 
> Does anyone else often get these annoying messages when running LyX from
> a terminal?
> 
> QXcbClipboard: SelectionRequest too old
> 
> I've been getting them for a while. I wonder if it is something
> particular to my system (e.g. because of the clipboard manager I use,
> CopyQ).
> 
> Scott

How do you trigger this output?

Kornel

signature.asc
Description: This is a digitally signed message part.


Annoying terminal messages: QXcbClipboard: SelectionRequest too old

2016-06-05 Thread Scott Kostyshak
Does anyone else often get these annoying messages when running LyX from
a terminal?

QXcbClipboard: SelectionRequest too old

I've been getting them for a while. I wonder if it is something
particular to my system (e.g. because of the clipboard manager I use,
CopyQ).

Scott


signature.asc
Description: PGP signature