|
From: Ethan M. <merritt@u.washington.edu> - 2006-02-01 22:10:29
|
On Wednesday 01 February 2006 12:36 pm, Petr Mikulik wrote: > Yes, that's amazing that gnuplot on X11 can save every > drawing as a screenshot into the clipboard. Actually it > looks rather like an undocumented feature. Now if someone could only tell me what this is good for... How can a screenshot be extracted from the clipboard to use elsewhere? Why would you want to do this rather than generating a *.png image directly from gnuplot? > What about having this as a 'set term x11' option instead of > .Xdefaults? Editing this file is not what a normal user > wants to (can) do. But ~/.Xdefaults is exactly where individual users are supposed to configure their preferences. It's where you set your favorite fonts, window placement, color schemes, are everything else that might be shared among your various X11 applications. If you were to add parsing code in 'set term x11 ...' for every relevant X resource, it would be an endless task. In recent generations of window managers, including both KDE and gnome, this has been to some degree superseded by "theming". But the .Xdefaults mechanism is still need for applications that are not fully integrated into whatever fancy desktop you run. We don't have a KDE-specific "knuplot" variant that would take these settings from the KDE theme instead. > Considering clipboard and KDE, the bug that "MB1" > double-click doesn't save mouse coordinate into clipboard > has not yet been fixed. It works for me. - double click MB1 in plot window - move mouse to editor or other control window - click middle mouse button -> saved mouse coordinates appear in input character stream This is independent of the "gnuplot*exportselection: on/off" setting. If the exportselection is "on", the at the same time the mouse coords are put into the clipboard, then also the plot itself is exported. Exporting the whole plot on each click seems like bad idea to me, but anyhow that's what it is doing right now. So what exactly is the bug? If you want to know why that same string doesn't also appear in klipper's history list - that I don't know. Ethan > Priority: 5 > Submitted By: Kevin Hobbs (gargon_the_rat) > Assigned to: Ethan Merritt (sfeam) > Summary: x11 CPU usage proportional to plot window size > > Initial Comment: > I've noticed that CPU usage increases when I make a > gnuplot window large. Usage stays high even without > interaction with the plot. > > The process that's doing the actual work seems to be X. > When I look at the output of top I see that X isn't > even on the list until I open a plot window. When I > open the plot window X jumps to 10%. If I make the > window small X drops off again, if I make the window > large X usage goes up as high as 50%. ( There is > another high usage process. ) > > The gnuplot is today's cvs configured with: > ./configure --prefix=/opt/gnuplot-cvs/ > --enable-history-file --with-x --with-readline=gnu > > the machine is > uname -a > Linux gargon.hooperlab 2.6.14-1.1656_FC4 #1 Thu Jan 5 > 22:13:55 EST 2006 x86_64 x86_64 x86_64 GNU/Linux > > --------------------------------------------------------------------- >- > > >Comment By: Petr Mikulik (mikulik) > > Date: 2006-02-01 20:36 > > Message: > Logged In: YES > user_id=31505 > > > > --------------------------------------------------------------------- >- > > Comment By: Ethan Merritt (sfeam) > Date: 2006-02-01 20:35 > > Message: > Logged In: YES > user_id=235620 > > Added to cvs. > > --------------------------------------------------------------------- >- > > Comment By: Ethan Merritt (sfeam) > Date: 2006-02-01 16:58 > > Message: > Logged In: YES > user_id=235620 > > gnuplot*ctrlq: on > This changes the "magic character that closes plot windows" > from 'q' to '<control>q'. I will add an explanation to the > documentation. > > As to the clipboard documentation - sorry, I do not really > understand it myself. Why would you want a plot on the > clipboard? What would you do with it once it is there? > These are all mysteries to me. I see from the comments that > Lars had a hand in that code. Perhaps he can explain what it > is intended to accomplish. > > --------------------------------------------------------------------- >- > > Comment By: Petr Mikulik (mikulik) > Date: 2006-02-01 15:38 > > Message: > Logged In: YES > user_id=31505 > > Thanks for fixing this! One my slower computer suffered from > this last week... > > I just looked into 'help x11 other_resources', and > - It writes > gnuplot*ctrlq: off > but there is no word what "ctrlq" means. Someone knows and > can it complete? > > - "By default the contents of the current plot window are > exported to the X11 clipboard in response to X events in the > window." -- this sentence is not clear for normal users. At > least I don't understand it properly. What does it want to > say? "By default snapshot of the current plot window is > copied to the X11 clipboard as a bitmap (?? what > resolution??) if/when ... ???" > Could you please rewrite this section? > > > --------------------------------------------------------------------- >- > > Comment By: Kevin Hobbs (gargon_the_rat) > Date: 2006-02-01 14:56 > > Message: > Logged In: YES > user_id=1064206 > > I applied your patch and rebuilt gnuplot. I re-enabled > klipper. I made a plot with the new gnuplot, and made it > really big. CPU usage drops back down a few seconds after > the resize. As far as I'm concerned the patch worked. > > > --------------------------------------------------------------------- >- > > Comment By: Ethan Merritt (sfeam) > Date: 2006-02-01 07:24 > > Message: > Logged In: YES > user_id=235620 > > And now that I have a system which can be made to exhibit > this problem.... > > Very strange behaviour. Gnuplot_x11 says "I want to export > a plot". Klipper goes into a loop, saying "Give me the > pixels; give me the colormap" over and over again until you > manually clear the clipboard. I have no idea why it does > this, but anyhow the attached patch limits gnuplot_x11 to > sending one copy each of the pixmap and colormap before > taking itself off the selection list. > > Please test and report any problems. And if you don't ever > want plots on the clipboard in the first place, use the > .Xdefaults file as shown in the previous comment. > > --------------------------------------------------------------------- >- > > Comment By: Ethan Merritt (sfeam) > Date: 2006-01-31 19:39 > > Message: > Logged In: YES > user_id=235620 > > Right. Then the following should fix your problem > temporarily > > echo "gnuplot*exportselection: off" | xrdb -merge > > And the permanent fix is to add a line to your ~/.Xdefaults file > > gnuplot*exportselection: off > > > What this has to do with KDE's kicker is a mystery to me. > The connection to klipper is obvious, but it should only > trigger on a mouse click. That might point to a bug of some > sort in gnuplot_x11, or it might be a weird problem in > kicker+klipper. > > --------------------------------------------------------------------- >- > > Comment By: Kevin Hobbs (gargon_the_rat) > Date: 2006-01-31 18:17 > > Message: > Logged In: YES > user_id=1064206 > > I am running KDE. Now that you mention it, I see that > kicker is also acting up. Bug #1225866 mentioned Klipper ( > I hate the thing ) I looked in Klipper and I see several > pictures of my plot. If I disable Klipper the crazy usage ends. > > I do think itmay be worth a cross post to KDE... I never > would have figured it out on my own. > > --------------------------------------------------------------------- >- > > Comment By: Ethan Merritt (sfeam) > Date: 2006-01-31 17:21 > > Message: > Logged In: YES > user_id=235620 > > Something similar has been reported a couple of times, but > so far as I recall it has turned out to be a problem or bug > in shell usage (#930426) or in the window manager (#1225866) > rather than in gnuplot per se. > > Having said that, there must still be something in > gnuplot_x11 that triggers this badness, but I don't know what. > > Please report what window manager you are using, and other > possibly relevant details like mouse focus policy, > iconification settings, and anything else you can think of. > > If you are running KDE, please check CPU usage by "kicker". > That was the culprit in at least one previous report, and > now that I check my brand-spanking-new system running KDE > 3.4.2 I see that kicker is indeed eating unreasonable > amounts of CPU time while gnuplot_x11 is running. I wonder > if it's worth a bug report or query to the KDE project? > > The only other thing I can think of to check on is font > usage. I have occasionally seen other apps cause X11 to > chew through CPU cycles if they use a font that is found in > an obsolete font cache. > > --------------------------------------------------------------------- >- > > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=102055&aid=1420675& >group_id=2055 -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle WA |