Re: Using XDnD in extensions

2013-03-21 Thread Joakim Soderlund
Sure,

I updated the patches and submitted a bug report.

https://bugzilla.gnome.org/show_bug.cgi?id=696321

Regards,
Joakim Soderlund

On Thu, Mar 21, 2013 at 3:07 AM, Tim  wrote:
> Joakim,
>   The best way to submit code/patches is via gnome.bugzilla.org, will more 
> likely be seen by the relevant devs then.
>
> Tim
>
> On 21/03/13 03:29, Joakim Soderlund wrote:
>> Hello!
>>
>> Seeing as what I wanted to do wasn't possible I created a patch which
>> extends the XDnD support in GNOME Shell. The patch allows for actors
>> to accept XDnD drops and retrieve information about them. You can find
>> the patch along with a simple extension demonstrating its usage at the
>> following URL:
>>
>> http://jocketf.se/files/xdnd/
>>
>> The patch and extension was written for GNOME Shell 3.6.2. If there is
>> any interest in this I can try to make it work for the Git master as
>> well.
>>
>> Regards,
>> Joakim Soderlund
>>
>> On Mon, Mar 11, 2013 at 10:10 AM, Joakim Söderlund
>>  wrote:
>>> Hello!
>>>
>>> Is there a way for extensions in GNOME Shell 3.6 to get information
>>> about XDnD drops other than just mouse cursor positions? The following
>>> code works fine for items from within GNOME Shell (such as application
>>> icons), but I can't seem to get any useful information about files
>>> dropped from Nautilus.
>>>
>>> /**
>>>  * Drag and drop test.
>>>  */
>>> const DndButton = new Lang.Class({
>>> Name: "DndButton",
>>> Extends: St.Button,
>>>
>>> _init: function() {
>>> this.parent();
>>>
>>> this.set_label("[DROP STUFF HERE]");
>>> this.set_position(5, 30);
>>> this.set_background_color(new Clutter.Color({
>>> red: 0,
>>> blue: 0,
>>> green: 0,
>>> alpha: 150,
>>> }));
>>>
>>> this._delegate = this;
>>>
>>> Main.layoutManager.addChrome(this);
>>> },
>>>
>>> handleDragOver: function(source, actor, x, y, time) {
>>> global.log(source);
>>> return DND.DragMotionResult.COPY_DROP;
>>> },
>>>
>>> acceptDrop: function(source, actor, x, y, time) {
>>> this.set_label("[ACCEPTED " + time + "]");
>>> return true;
>>> },
>>> });
>>>
>>> Also, although handleDragOver gets called for XDnD, returning
>>> COPY_DROP seems to do nothing. The source parameter is assigned an
>>> xdndHandler instance, but it doesn't seem to contain any useful
>>> information.
>>>
>>> Regards,
>>> Joakim Söderlund
>> ___
>> gnome-shell-list mailing list
>> gnome-shell-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gnome-shell-list
>
> ___
> gnome-shell-list mailing list
> gnome-shell-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gnome-shell-list
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: Using XDnD in extensions

2013-03-20 Thread Sriram Ramkrishna
On Wed, Mar 20, 2013 at 7:07 PM, Tim  wrote:

> Joakim,
>   The best way to submit code/patches is via gnome.bugzilla.org, will
> more likely be seen by the relevant devs then.
>
>
+1

Please do this, Joakim.  Thank you for your contribution!  I hope the
maintainer merges it!

sri


> Tim
>
> On 21/03/13 03:29, Joakim Soderlund wrote:
> > Hello!
> >
> > Seeing as what I wanted to do wasn't possible I created a patch which
> > extends the XDnD support in GNOME Shell. The patch allows for actors
> > to accept XDnD drops and retrieve information about them. You can find
> > the patch along with a simple extension demonstrating its usage at the
> > following URL:
> >
> > http://jocketf.se/files/xdnd/
> >
> > The patch and extension was written for GNOME Shell 3.6.2. If there is
> > any interest in this I can try to make it work for the Git master as
> > well.
> >
> > Regards,
> > Joakim Soderlund
> >
> > On Mon, Mar 11, 2013 at 10:10 AM, Joakim Söderlund
> >  wrote:
> >> Hello!
> >>
> >> Is there a way for extensions in GNOME Shell 3.6 to get information
> >> about XDnD drops other than just mouse cursor positions? The following
> >> code works fine for items from within GNOME Shell (such as application
> >> icons), but I can't seem to get any useful information about files
> >> dropped from Nautilus.
> >>
> >> /**
> >>  * Drag and drop test.
> >>  */
> >> const DndButton = new Lang.Class({
> >> Name: "DndButton",
> >> Extends: St.Button,
> >>
> >> _init: function() {
> >> this.parent();
> >>
> >> this.set_label("[DROP STUFF HERE]");
> >> this.set_position(5, 30);
> >> this.set_background_color(new Clutter.Color({
> >> red: 0,
> >> blue: 0,
> >> green: 0,
> >> alpha: 150,
> >> }));
> >>
> >> this._delegate = this;
> >>
> >> Main.layoutManager.addChrome(this);
> >> },
> >>
> >> handleDragOver: function(source, actor, x, y, time) {
> >> global.log(source);
> >> return DND.DragMotionResult.COPY_DROP;
> >> },
> >>
> >> acceptDrop: function(source, actor, x, y, time) {
> >> this.set_label("[ACCEPTED " + time + "]");
> >> return true;
> >> },
> >> });
> >>
> >> Also, although handleDragOver gets called for XDnD, returning
> >> COPY_DROP seems to do nothing. The source parameter is assigned an
> >> xdndHandler instance, but it doesn't seem to contain any useful
> >> information.
> >>
> >> Regards,
> >> Joakim Söderlund
> > ___
> > gnome-shell-list mailing list
> > gnome-shell-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/gnome-shell-list
>
> ___
> gnome-shell-list mailing list
> gnome-shell-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gnome-shell-list
>
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: Using XDnD in extensions

2013-03-20 Thread Tim
Joakim,
  The best way to submit code/patches is via gnome.bugzilla.org, will more 
likely be seen by the relevant devs then.

Tim

On 21/03/13 03:29, Joakim Soderlund wrote:
> Hello!
>
> Seeing as what I wanted to do wasn't possible I created a patch which
> extends the XDnD support in GNOME Shell. The patch allows for actors
> to accept XDnD drops and retrieve information about them. You can find
> the patch along with a simple extension demonstrating its usage at the
> following URL:
>
> http://jocketf.se/files/xdnd/
>
> The patch and extension was written for GNOME Shell 3.6.2. If there is
> any interest in this I can try to make it work for the Git master as
> well.
>
> Regards,
> Joakim Soderlund
>
> On Mon, Mar 11, 2013 at 10:10 AM, Joakim Söderlund
>  wrote:
>> Hello!
>>
>> Is there a way for extensions in GNOME Shell 3.6 to get information
>> about XDnD drops other than just mouse cursor positions? The following
>> code works fine for items from within GNOME Shell (such as application
>> icons), but I can't seem to get any useful information about files
>> dropped from Nautilus.
>>
>> /**
>>  * Drag and drop test.
>>  */
>> const DndButton = new Lang.Class({
>> Name: "DndButton",
>> Extends: St.Button,
>>
>> _init: function() {
>> this.parent();
>>
>> this.set_label("[DROP STUFF HERE]");
>> this.set_position(5, 30);
>> this.set_background_color(new Clutter.Color({
>> red: 0,
>> blue: 0,
>> green: 0,
>> alpha: 150,
>> }));
>>
>> this._delegate = this;
>>
>> Main.layoutManager.addChrome(this);
>> },
>>
>> handleDragOver: function(source, actor, x, y, time) {
>> global.log(source);
>> return DND.DragMotionResult.COPY_DROP;
>> },
>>
>> acceptDrop: function(source, actor, x, y, time) {
>> this.set_label("[ACCEPTED " + time + "]");
>> return true;
>> },
>> });
>>
>> Also, although handleDragOver gets called for XDnD, returning
>> COPY_DROP seems to do nothing. The source parameter is assigned an
>> xdndHandler instance, but it doesn't seem to contain any useful
>> information.
>>
>> Regards,
>> Joakim Söderlund
> ___
> gnome-shell-list mailing list
> gnome-shell-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gnome-shell-list

___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: Using XDnD in extensions

2013-03-20 Thread Sam Bull
On Wed, 2013-03-20 at 17:29 +0100, Joakim Soderlund wrote:
> Seeing as what I wanted to do wasn't possible I created a patch which
> extends the XDnD support in GNOME Shell. The patch allows for actors
> to accept XDnD drops and retrieve information about them.

Excellent, there are a couple of extensions which could do with DnD
support. I hope this gets pulled into the official release, so we can
start using it.



signature.asc
Description: This is a digitally signed message part
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list


Re: Using XDnD in extensions

2013-03-20 Thread Joakim Soderlund
Hello!

Seeing as what I wanted to do wasn't possible I created a patch which
extends the XDnD support in GNOME Shell. The patch allows for actors
to accept XDnD drops and retrieve information about them. You can find
the patch along with a simple extension demonstrating its usage at the
following URL:

http://jocketf.se/files/xdnd/

The patch and extension was written for GNOME Shell 3.6.2. If there is
any interest in this I can try to make it work for the Git master as
well.

Regards,
Joakim Soderlund

On Mon, Mar 11, 2013 at 10:10 AM, Joakim Söderlund
 wrote:
> Hello!
>
> Is there a way for extensions in GNOME Shell 3.6 to get information
> about XDnD drops other than just mouse cursor positions? The following
> code works fine for items from within GNOME Shell (such as application
> icons), but I can't seem to get any useful information about files
> dropped from Nautilus.
>
> /**
>  * Drag and drop test.
>  */
> const DndButton = new Lang.Class({
> Name: "DndButton",
> Extends: St.Button,
>
> _init: function() {
> this.parent();
>
> this.set_label("[DROP STUFF HERE]");
> this.set_position(5, 30);
> this.set_background_color(new Clutter.Color({
> red: 0,
> blue: 0,
> green: 0,
> alpha: 150,
> }));
>
> this._delegate = this;
>
> Main.layoutManager.addChrome(this);
> },
>
> handleDragOver: function(source, actor, x, y, time) {
> global.log(source);
> return DND.DragMotionResult.COPY_DROP;
> },
>
> acceptDrop: function(source, actor, x, y, time) {
> this.set_label("[ACCEPTED " + time + "]");
> return true;
> },
> });
>
> Also, although handleDragOver gets called for XDnD, returning
> COPY_DROP seems to do nothing. The source parameter is assigned an
> xdndHandler instance, but it doesn't seem to contain any useful
> information.
>
> Regards,
> Joakim Söderlund
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list


Using XDnD in extensions

2013-03-11 Thread Joakim Söderlund
Hello!

Is there a way for extensions in GNOME Shell 3.6 to get information
about XDnD drops other than just mouse cursor positions? The following
code works fine for items from within GNOME Shell (such as application
icons), but I can't seem to get any useful information about files
dropped from Nautilus.

/**
 * Drag and drop test.
 */
const DndButton = new Lang.Class({
Name: "DndButton",
Extends: St.Button,

_init: function() {
this.parent();

this.set_label("[DROP STUFF HERE]");
this.set_position(5, 30);
this.set_background_color(new Clutter.Color({
red: 0,
blue: 0,
green: 0,
alpha: 150,
}));

this._delegate = this;

Main.layoutManager.addChrome(this);
},

handleDragOver: function(source, actor, x, y, time) {
global.log(source);
return DND.DragMotionResult.COPY_DROP;
},

acceptDrop: function(source, actor, x, y, time) {
this.set_label("[ACCEPTED " + time + "]");
return true;
},
});

Also, although handleDragOver gets called for XDnD, returning
COPY_DROP seems to do nothing. The source parameter is assigned an
xdndHandler instance, but it doesn't seem to contain any useful
information.

Regards,
Joakim Söderlund
___
gnome-shell-list mailing list
gnome-shell-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list