RSS/Atom feed Twitter
Site is read-only, email is disabled

Clipboard (was Re: Screenshot plug-in status)

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

23 of 23 messages available
Toggle history

Please log in to manage your subscriptions.

Screenshot plug-in status Henrik Brix Andersen 04 Sep 21:42
  Screenshot plug-in status Tor Lillqvist 06 Sep 09:16
   Screenshot plug-in status Henrik Brix Andersen 06 Sep 15:31
    Screenshot plug-in status Tor Lillqvist 06 Sep 18:55
     Screenshot plug-in status Henrik Brix Andersen 06 Sep 19:15
     Screenshot plug-in status Sven Neumann 07 Sep 13:17
      Screenshot plug-in status Alan Horkan 10 Sep 21:18
       Screenshot plug-in status Michael Schumacher 10 Sep 22:04
        Screenshot plug-in status Sven Neumann 11 Sep 02:04
         Screenshot plug-in status Alan Horkan 11 Sep 21:11
Screenshot plug-in status Hans Breuer 11 Sep 08:54
  Screenshot plug-in status Alan Horkan 11 Sep 19:49
   Clipboard (was Re: Screenshot plug-in status) Nick Lamb 11 Sep 21:01
    Clipboard (was Re: Screenshot plug-in status) Sven Neumann 12 Sep 12:38
     Clipboard (was Re: Screenshot plug-in status) Nick Lamb 12 Sep 17:09
      Clipboard (was Re: Screenshot plug-in status) Sven Neumann 12 Sep 19:37
      Clipboard (was Re: Screenshot plug-in status) David Neary 15 Sep 11:38
       Clipboard (was Re: Screenshot plug-in status) Sven Neumann 15 Sep 12:09
   Screenshot plug-in status Nathan Carl Summers 11 Sep 21:32
   Screenshot plug-in status Tor Lillqvist 12 Sep 07:07
    Screenshot plug-in status Sven Neumann 12 Sep 12:42
Screenshot plug-in status Phil Harper 12 Sep 02:29
Screenshot plug-in status Tor Lillqvist 12 Sep 12:53
Henrik Brix Andersen
2003-09-04 21:42:37 UTC (over 21 years ago)

Screenshot plug-in status

Hi all,

I recently replaced a large part of the screenshot plug-in (plug-ins/common/screenshot.c) - now it no longer depend on the external 'xwd' utility from XFree86 to work.

I have prepared the screenshot plug-in for compilation on different GDK back ends than X11, but I have no means experience coding for these back ends nor the means to test the plug-in on them.

It would be nice if someone on say... win32 ;)... would have a go at writing the missing win32 part of the select_window() function. It really should be simple. As a matter of fact that someone could look at the win32 specific winsnap plug-in to see how it is done there.

The comments in plug-ins/common/screenshot.c explains pretty much what the code should do.

When the win32 specific part of select_window() has been written and committed I plan to retire the win32 specific winsnap plug-in in favor of the new screenshot plug-in.

If you have any questions don't hesitate to write me - or follow up on the list.

Sincerely,
./Brix

Tor Lillqvist
2003-09-06 09:16:51 UTC (over 21 years ago)

Screenshot plug-in status

Henrik Brix Andersen writes:
> It would be nice if someone on say... win32 ;)... would have a go at > writing the missing win32 part of the select_window() function.

I get the hint ;-). I'll have a look at it.

Grabbing the whole screen with screenshot (without any Win32 specific code yet) was *much* slower than with winsnap. It was the image transfer phase from the plug-in to GIMP that was a lot slower. I tried to change the code to just call gimp_pixel_rgn_set_rect() once, like winsnap does, instead of calling gimp_pixel_rgn_set_row() in a loop. And it is now much speedier. Do you see any reason why this should not be done? (Maybe also call gimp_tile_cache_size(), although calling it like winsnap.c does results in black screendumps, oddly enough.)

> When the win32 specific part of select_window() has been written and > committed I plan to retire the win32 specific winsnap plug-in in favor > of the new screenshot plug-in.

BTW, shouldn't it be possible to write select_window() using only GDK? gdk_pointer_grab() and, hmmm, well I'll think about it.

--tml

(Wonder why it seems to take so long for messages to go through gimp-developer@lists.xcf.berkeley.edu. Two or three days. Sobig.F?)

Henrik Brix Andersen
2003-09-06 15:31:36 UTC (over 21 years ago)

Screenshot plug-in status

Hi,

On Sat, 2003-09-06 at 09:16, Tor Lillqvist wrote:

Henrik Brix Andersen writes:
> It would be nice if someone on say... win32 ;)... would have a go at > writing the missing win32 part of the select_window() function.

I get the hint ;-). I'll have a look at it.

Hehe - was the hint that obvious?

Grabbing the whole screen with screenshot (without any Win32 specific code yet) was *much* slower than with winsnap. It was the image transfer phase from the plug-in to GIMP that was a lot slower. I tried to change the code to just call gimp_pixel_rgn_set_rect() once, like winsnap does, instead of calling gimp_pixel_rgn_set_row() in a loop. And it is now much speedier. Do you see any reason why this should not be done? (Maybe also call gimp_tile_cache_size(), although calling it like winsnap.c does results in black screendumps, oddly enough.)

Using gimp_pixel_rgn_set_row() may work for some images, but since GdkPixbufs internally have aligned data which may result in padding garbage inserted between two rows, you will need to use gdk_pixbuf_get_rowstride() and iterate over the rows one by one.

If you can come up with a better (faster?) solution to this problem please don't hesitate to commit it.

When the win32 specific part of select_window() has been written and

> committed I plan to retire the win32 specific winsnap plug-in in favor > of the new screenshot plug-in.

BTW, shouldn't it be possible to write select_window() using only GDK? gdk_pointer_grab() and, hmmm, well I'll think about it.

Unfortunately this doesn't seem to be possible. Believe me, I've tried :(. Since GDK knows nothing about other programs windows there is no way of obtaining the window ID (XID or HWND) for these using plain GDK.

I have close to no experience in MS Windows programming, but using Xlib you can use the subwindow member of the Xevent struct to get the ID of the window which recieved the event. GDK events structs has no such member.

(Wonder why it seems to take so long for messages to go through gimp-developer@lists.xcf.berkeley.edu. Two or three days. Sobig.F?)

Nope. Apparently lists.xcf.berkeley.edu is running low on RAM - please see http://bugzilla.gnome.org/show_bug.cgi?id=121086

Sincerely, ./Brix

Tor Lillqvist
2003-09-06 18:55:13 UTC (over 21 years ago)

Screenshot plug-in status

Henrik Brix Andersen writes:
> Using gimp_pixel_rgn_set_row() may work for some images, but since > GdkPixbufs internally have aligned data which may result in padding > garbage inserted between two rows, you will need to use > gdk_pixbuf_get_rowstride() and iterate over the rows one by one.

But couldn't one at least check if gdk_pixbuf_get_rowstride() indicates that there isn't any padding, and in that case use gimp_pixel_rgn_set_rect()? At least on my aging PIII-450, the difference in speed is huge.

> Unfortunately this doesn't seem to be possible. Believe me, I've tried > :(.

OK, I believe you...

--tml

Henrik Brix Andersen
2003-09-06 19:15:07 UTC (over 21 years ago)

Screenshot plug-in status

On Sat, 2003-09-06 at 18:55, Tor Lillqvist wrote:

Henrik Brix Andersen writes:
> Using gimp_pixel_rgn_set_row() may work for some images, but since > GdkPixbufs internally have aligned data which may result in padding > garbage inserted between two rows, you will need to use > gdk_pixbuf_get_rowstride() and iterate over the rows one by one.

But couldn't one at least check if gdk_pixbuf_get_rowstride() indicates that there isn't any padding, and in that case use gimp_pixel_rgn_set_rect()? At least on my aging PIII-450, the difference in speed is huge.

Well, I guess you could test if (rowstride / 3 == width) and call _set_rect() instead of _set_row().

Sincerely, ./Brix

Sven Neumann
2003-09-07 13:17:47 UTC (over 21 years ago)

Screenshot plug-in status

Hi,

Tor Lillqvist writes:

Henrik Brix Andersen writes:
> Using gimp_pixel_rgn_set_row() may work for some images, but since > GdkPixbufs internally have aligned data which may result in padding > garbage inserted between two rows, you will need to use > gdk_pixbuf_get_rowstride() and iterate over the rows one by one.

But couldn't one at least check if gdk_pixbuf_get_rowstride() indicates that there isn't any padding, and in that case use gimp_pixel_rgn_set_rect()? At least on my aging PIII-450, the difference in speed is huge.

I am surprised that this makes any noticeable difference and I think it would be worth to check the reason for this. A much simpler optimization would probably to set a reasonable tile_cache size. At the moment the new screenshot plug-in fails to do that.

Sven

Alan Horkan
2003-09-10 21:18:05 UTC (over 21 years ago)

Screenshot plug-in status

On 7 Sep 2003, Sven Neumann wrote:

Date: 07 Sep 2003 13:17:47 +0200
From: Sven Neumann
To: Tor Lillqvist
Cc: "gimp-developer@lists.xcf.berkeley.edu"
Subject: Re: [Gimp-developer] Screenshot plug-in status

Hi,

Tor Lillqvist writes:

(slightly Offtopic and delayed reply)

While a Screenshot plugin can be useful (easy enough to discover) it was never what I really what I wanted as a windows user.

Rather I would have much preffered to be able to simply use the built in Print Scrn (or Alt+Print Scrn to grab just the current window) and paste that into the GIMP.

Unfortunately the GIMP only me to choose File, Aqquire, From Clipboard. Could pasting from the system ClipBoard be setup in such a way as to allow me to directly paste screenshots without needing to take the extra few clicks to Aquire from clipboard or use the Screenshot plugin?

Should I file an enhancenment request in bugzilla?

- Alan H.

Michael Schumacher
2003-09-10 22:04:46 UTC (over 21 years ago)

Screenshot plug-in status

On 10 Sep 2003 at 20:18, Alan Horkan wrote:

While a Screenshot plugin can be useful (easy enough to discover) it was never what I really what I wanted as a windows user.

Rather I would have much preffered to be able to simply use the built in Print Scrn (or Alt+Print Scrn to grab just the current window) and paste that into the GIMP.

This works perfectly for me with GIMP 1.2 and 1.3. I assigned shortkeys to the corresponding menu options in the Edit menu.

Michael

Sven Neumann
2003-09-11 02:04:24 UTC (over 21 years ago)

Screenshot plug-in status

Hi,

"Michael Schumacher" writes:

While a Screenshot plugin can be useful (easy enough to discover) it was never what I really what I wanted as a windows user.

Rather I would have much preffered to be able to simply use the built in Print Scrn (or Alt+Print Scrn to grab just the current window) and paste that into the GIMP.

Perhaps you should use GNOME then ;)

Sven

Hans Breuer
2003-09-11 08:54:59 UTC (over 21 years ago)

Screenshot plug-in status

At 20:18 10.09.03 +0100, Alan Horkan wrote:

While a Screenshot plugin can be useful (easy enough to discover) it was never what I really what I wanted as a windows user.

Rather I would have much preffered to be able to simply use the built in Print Scrn (or Alt+Print Scrn to grab just the current window) and paste that into the GIMP.

Unfortunately the GIMP only me to choose File, Aqquire, From Clipboard.

Which you never tried at least _once_ before complaining ?

Though from the users point of view there may be no differnce between 'Copy' (== here Program internal and fast) and
'Copy from Clipboard' (== system global, data across process boundaries, kind of slow) [Available from File/Acquire (creating new) and /Edit/Paste from Clipboard pasting into current image. ]

From the developers point of view there is. [If it's still unclear, the

later is the one you are asking for. And it exists for years.]

Could pasting from the system ClipBoard be setup in such a way as to allow me to directly paste screenshots without needing to take the extra few clicks to Aquire from clipboard or use the Screenshot plugin?

Huh? May I suggest a hot key : ctrl-alt-ins ?

Should I file an enhancenment request in bugzilla?

Or better ctrl-alt-del ...

Hans

-------- Hans "at" Breuer "dot" Org ----------- Tell me what you need, and I'll tell you how to get along without it. -- Dilbert

Alan Horkan
2003-09-11 19:49:42 UTC (over 21 years ago)

Screenshot plug-in status

On Thu, 11 Sep 2003, Hans Breuer wrote:

Unfortunately the GIMP only me to choose File, Aqquire, From Clipboard.

Which you never tried at least _once_ before complaining ?

I think you have misunderstood me. I used it many times, it works and I use what is available. I only mention it now because changes are being made to the screenshot code and perhaps there might be a better way to do screenshots and streamline the workflow.

Though from the users point of view there may be no differnce between 'Copy' (== here Program internal and fast) and
'Copy from Clipboard' (== system global, data across process boundaries, kind of slow)

I am aware that the system clipboard is different and slower, but isn't the real performance loss is from the user point of view.

I only ask that you take a moment and consider if there might be a way to make things faster for the user which is where speed really counts. Could some of the handling of the system clipboard be done automatically and only when needed to mitigate the speed tradeoff? If is impractical fair enough, I was just asking because the code was being changed anyway.

- Alan

Nick Lamb
2003-09-11 21:01:15 UTC (over 21 years ago)

Clipboard (was Re: Screenshot plug-in status)

On Thu, Sep 11, 2003 at 06:49:42PM +0100, Alan Horkan wrote:

I only ask that you take a moment and consider if there might be a way to make things faster for the user which is where speed really counts. Could some of the handling of the system clipboard be done automatically and only when needed to mitigate the speed tradeoff? If is impractical fair enough, I was just asking because the code was being changed anyway.

It should work that way but I haven't been able to build The GIMP to check for ages now.

To be completely clear: Edit/Cut, Copy and Paste _ought_ to transparently work between applications. The image-related KDE apps get this right and when GIMP 1.3.x devel code is once again up and running on this system I will ensure that it works properly in the GIMP too.

You are quite right that none of this costs _any_ significant resources until it's actually used to do what the _user_ wants. Which means it is unquestionably the Right Thing.

Nick.

Alan Horkan
2003-09-11 21:11:47 UTC (over 21 years ago)

Screenshot plug-in status

On 11 Sep 2003, Sven Neumann wrote:

Date: 11 Sep 2003 02:04:24 +0200
From: Sven Neumann
To: Michael Schumacher
Cc: "gimp-developer@lists.xcf.berkeley.edu"
Subject: Re: [Gimp-developer] Screenshot plug-in status

Hi,

"Michael Schumacher" writes:

While a Screenshot plugin can be useful (easy enough to discover) it was never what I really what I wanted as a windows user.

Rather I would have much preffered to be able to simply use the built in Print Scrn (or Alt+Print Scrn to grab just the current window) and paste that into the GIMP.

Perhaps you should use GNOME then ;)

I do use Gnome, just not all the time.

- Alan

Nathan Carl Summers
2003-09-11 21:32:11 UTC (over 21 years ago)

Screenshot plug-in status

On Thu, 11 Sep 2003, Alan Horkan wrote:

I only ask that you take a moment and consider if there might be a way to make things faster for the user which is where speed really counts. Could some of the handling of the system clipboard be done automatically and only when needed to mitigate the speed tradeoff? If is impractical fair enough, I was just asking because the code was being changed anyway.

It seems to me that using the system clipboard, but using the internal cut and paste instead of the system functionality whenever it is detected that the sender and reciever are the same process would be the best solution.

Rockwalrus

Phil Harper
2003-09-12 02:29:35 UTC (over 21 years ago)

Screenshot plug-in status

From: Alan Horkan
CC: gimp-developer@lists.xcf.berkeley.edu Subject: Re: [Gimp-developer] Screenshot plug-in status Date: Thu, 11 Sep 2003 18:49:42 +0100 (BST)

On Thu, 11 Sep 2003, Hans Breuer wrote:

Unfortunately the GIMP only me to choose File, Aqquire, From Clipboard.

Which you never tried at least _once_ before complaining ?

I think you have misunderstood me. I used it many times, it works and I use what is available. I only mention it now because changes are being made to the screenshot code and perhaps there might be a better way to do screenshots and streamline the workflow.

Though from the users point of view there may be no differnce between 'Copy' (== here Program internal and fast) and
'Copy from Clipboard' (== system global, data across process boundaries, kind of slow)

I am aware that the system clipboard is different and slower, but isn't the real performance loss is from the user point of view.

I only ask that you take a moment and consider if there might be a way to make things faster for the user which is where speed really counts. Could some of the handling of the system clipboard be done automatically and only when needed to mitigate the speed tradeoff? If is impractical fair enough, I was just asking because the code was being changed anyway.

well, i am very happy with the way GIMP's clipboard and buffers are kept separated from the win32 clipboard, i frequently keep text lying around in the win32 clipboard that i may well use frequently, but i very rarely need to copy image data outside of the GIMP, and this way i can have all my named buffers, i can cut and paste between GIMP images while keeping my text in the clipboard for use in text editors and web browsers, handy if you're multitasking.

so, on to screenshots, i sometimes use alt-printscrn and acquire, but more often acquire screenshot, as that way i don't nuke the contents of the clipboard.

i may have completely missed the point here, but i think keeping clipboard functions the way they are and maybe adding a paste as new from clipboard function along with the others so that acquire doesn't have to be used every time.

Phil.

- Alan

Tor Lillqvist
2003-09-12 07:07:51 UTC (over 21 years ago)

Screenshot plug-in status

Alan Horkan writes:
> I was just asking because the code was being changed anyway.

Well, actually it's not certain at all that the screenshot code used on Win32 will be changed. The winsnap plug-in works, and even if code from it was copied into screenshot.c, it wouldn't still work the same way as on X11 (i.e., you still would have to select the window to grab by dragging the mouse and release the button when on top of the target window, not just move the mouse and click when on top), so why bother... Additionally the winsnap code requires currently an .rc file, and taking care of that in plug-ins/common/Makefile.am would cause additional pain.

(Making it work like on X11 would require some pretty hairy changes to the way GDK mouse grabs are implemented on Win32 (and keyboard grabs while at it), won't presumably happen soon. See my post on gtk-devel-list.)

--tml

Sven Neumann
2003-09-12 12:38:26 UTC (over 21 years ago)

Clipboard (was Re: Screenshot plug-in status)

Hi,

Nick Lamb writes:

It should work that way but I haven't been able to build The GIMP to check for ages now.

To be completely clear: Edit/Cut, Copy and Paste _ought_ to transparently work between applications. The image-related KDE apps get this right and when GIMP 1.3.x devel code is once again up and running on this system I will ensure that it works properly in the GIMP too.

Oh, will you? I am sorry but if I remember correctly we postponed this until after 2.0 since we hope that until then there well be an accepted Free Desktop standard for this. Our prefered solution would be to offer the image data as image/png and so far there seems to be consensus that this is a good choice.

Sven

Sven Neumann
2003-09-12 12:42:12 UTC (over 21 years ago)

Screenshot plug-in status

Hi,

Tor Lillqvist writes:

Additionally the winsnap code requires currently an .rc file, and taking care of that in plug-ins/common/Makefile.am would cause additional pain.

This argument is nil since we can always move screenshot to it's own subdirectory.

I was hoping that there was interest in getting rid of (almost) all differences between platforms and doing a common screenshot plug-in would be one more step towards this goal. Sad to hear that you prefer to keep the winsnap plug-in alive.

Sven

Tor Lillqvist
2003-09-12 12:53:45 UTC (over 21 years ago)

Screenshot plug-in status

I was hoping that there was interest in getting rid of (almost) all differences between platforms and doing a common screenshot plug-in would be one more step towards this goal. Sad to hear that you prefer to keep the winsnap plug-in alive.

Well yes, that is a good goal. But as it started to seem that the "common" screenshot plug-in would still need to contain a lot of the Windows-specific code from winsnap.c (i.e., not just a short code snippet inside one function like for X11), I just thought it wouldn't be worth the effort.

--tml

Nick Lamb
2003-09-12 17:09:24 UTC (over 21 years ago)

Clipboard (was Re: Screenshot plug-in status)

On Fri, Sep 12, 2003 at 12:38:26PM +0200, Sven Neumann wrote:

Oh, will you? I am sorry but if I remember correctly we postponed this until after 2.0 since we hope that until then there well be an accepted Free Desktop standard for this. Our prefered solution would be to offer the image data as image/png and so far there seems to be consensus that this is a good choice.

Any Free Desktop standard for routine image clipboard handling seems to have been overtaken by events. There might still be room for some discussion about hi-resolution or hi-precision graphics, but for the average user the de facto standard is already set and since there's nothing obviously wrong with it we can move on from there. X content negotation lets us change our minds later, and GIMP's plug-in architecture lets us make this modular if we decide that's necessary...

Is there any engineering reason why this shouldn't happen prior to 2.0, assuming the spirit of Free Time is on our side?

Nick.

Sven Neumann
2003-09-12 19:37:31 UTC (over 21 years ago)

Clipboard (was Re: Screenshot plug-in status)

Hi,

Nick Lamb writes:

Any Free Desktop standard for routine image clipboard handling seems to have been overtaken by events. There might still be room for some discussion about hi-resolution or hi-precision graphics, but for the average user the de facto standard is already set and since there's nothing obviously wrong with it we can move on from there.

Sorry, but what is, in your opinion, the de facto standard?

Is there any engineering reason why this shouldn't happen prior to 2.0, assuming the spirit of Free Time is on our side?

It would break the feature freeze but since we aren't yet handling the freeze very strictly and since we actually wanted to have this in 2.0, a clean patch that arrives before the end of the month could probably still be considered.

Sven

David Neary
2003-09-15 11:38:11 UTC (over 21 years ago)

Clipboard (was Re: Screenshot plug-in status)

Nick Lamb wrote:

On Fri, Sep 12, 2003 at 12:38:26PM +0200, Sven Neumann wrote:

Oh, will you? I am sorry but if I remember correctly we postponed this until after 2.0 since we hope that until then there well be an accepted Free Desktop standard for this. Our prefered solution would be to offer the image data as image/png and so far there seems to be consensus that this is a good choice.

I had hoped to spend time on this before 2.0 pre1, but that's not going to happen now. And it does kind of break the feature freeze. But it shouldn't be a huge packet of code.

Any Free Desktop standard for routine image clipboard handling seems to have been overtaken by events. There might still be room for some discussion about hi-resolution or hi-precision graphics, but for the average user the de facto standard is already set and since there's nothing obviously wrong with it we can move on from there. X content negotation lets us change our minds later, and GIMP's plug-in architecture lets us make this modular if we decide that's necessary...

I'm not aware of any de facto standard - how does kde pass image data around? The only clipboard standard I know of is the one on freedesktop which says "Explicit copy -> use SECONDARY", and keeps the selected buffer = PRIMARY as an easter egg which isn't really going to be used much in future.

There is no standard for image data interchange that I know of, and I did have a look.

Is there any engineering reason why this shouldn't happen prior to 2.0, assuming the spirit of Free Time is on our side?

That's a fairly big assumption :) 2.0 pre 1 (which will be absolutely string & feature frozen to give translators, documentors and the like time to clean up before 2.0) is planned for a fortnights time. There are only 2 or 3 blockers left for that release, and they're all pretty small. So the spirit of Free Time is the biggest problem I see with it :)

It would be nice if we did this in a way which would interoperrate with other apps, though - which is why using image/png is so attractive. Even if we were to use something else between different gimp instances, we get to communicate with everyone who understands png.

As to freedesktop, as I said I'm not aware of any standard (de facto or otherwise) - I had planned to write up a proposal to use as the basis of a freedesktop proposal after 2.0 pre1 gets out the door. But if you implement something in the meantime, there shouldn't be any problem getting it in, as long as it's feature complete and fairly clean (as Sven said).
Cheers,
Dave.

Sven Neumann
2003-09-15 12:09:27 UTC (over 21 years ago)

Clipboard (was Re: Screenshot plug-in status)

Hi,

David Neary writes:

That's a fairly big assumption :) 2.0 pre 1 (which will be absolutely string & feature frozen to give translators, documentors and the like time to clean up before 2.0) is planned for a fortnights time. There are only 2 or 3 blockers left for that release, and they're all pretty small.

If your plan is to do a complete string freeze, I see a couple more than 2 or 3 blockers. But yes, we should try to avoid changes to translatable messages when the time has come for the prereleases.

Sven