sourcegraph / go-webkit2

WebKit API bindings (WebKitGTK+ v2) for Go
https://sourcegraph.com/github.com/sourcegraph/go-webkit2
Other
313 stars 61 forks source link

GtkOffscreenWindow? #8

Open mdimec4 opened 10 years ago

mdimec4 commented 10 years ago

Hello

This is a great gtk port, but I am currently missing one thing in it. I am talking about GtkOffscreenWindow implementation. Functions to create offscreen window and functions ti access window image. I am asking if there is any plan to implement this in the near future? Or if I can tray to implement it to be then merged with master branch? Best

Miha

mdimec4 commented 10 years ago

Gtk Documentation about feature. https://developer.gnome.org/gtk3/stable/GtkOffscreenWindow.html

sqs commented 10 years ago

No plans but I would happily merge a patch.

Sent from my iPhone

On Jan 10, 2014, at 4:58, mdimec4 notifications@github.com wrote:

Hello

This is a great gtk port, but I am currently missing one thing in it. I am talking about GtkOffscreenWindow implementation. Functions to create offscreen window and functions ti access window image. I am asking if there is any plan to implement this in the near future? Or if I can tray to implement it to be then merged with master branch? Best

Miha

— Reply to this email directly or view it on GitHub.

mdimec4 commented 10 years ago

Hi I have written the patch with the help of jrick. I have also sanded this patch to him. http://pastebin.com/DjeDcHLP Patch also changes library import paths to my fork. If you apply this patch you mast care to change it back.

I am new to gitgub.com. So if you don't mind I would like to ask you what is usual convention to transfer work between branches. For example how would I upgrade my branch with new commits from your or jricks branch. I assume all I have to do is: git pull [your repo] git push origin Am I right?

sqs commented 10 years ago

Awesome. Thanks for the patch!

On your visionect/go-webkit2 fork, push your changes to a branch (called like "GtkOffscreenWindow") and then go to https://github.com/visionect/go-webkit2 and there should be a big green button called "Compare" or similar that will let you create a pull request. Submit a pull request to sourcegraph/go-webkit2 to merge your GtkOffscreenWindow branch into sourcegraph/go-webkit2 master branch, and then we can take it from there.

paultag commented 7 years ago

@mdimec4 is there any chance you could do the above and send this in as a PR? I'd love to use this feature!

mdimec4 commented 7 years ago

@paultag it was done in https://github.com/conformal/gotk3. But current version of go-webkit in this branch uses different fork of gotk3 anyway.

And the good news is, that it should also support off-screen window.

You can create window, like you normally do in GTK, jut use OffscreenWindowNew() instead. https://github.com/gotk3/gotk3/blob/master/gtk/gtk.go#L5686

Then you can like you normally do add WebView widget to it, and you can use it.

You will probably find useful:

https://github.com/sourcegraph/go-webkit2/blob/master/webkit2/webview.go#L187

and/or

https://github.com/gotk3/gotk3/blob/master/gtk/gtk.go#L5696

And for documentation you can always check: https://webkitgtk.org/reference/webkit2gtk/stable/index.html