@@ -396,31 +396,37 @@ static void
396396drag_start (PlumaNotebook * notebook ,
397397 guint32 time )
398398{
399+ GdkSeat * seat ;
400+ GdkDevice * device ;
401+ GdkDisplay * display ;
402+
403+ display = gtk_widget_get_display (GTK_WIDGET (notebook ));
404+ seat = gdk_display_get_default_seat (display );
405+ device = gdk_seat_get_pointer (seat );
406+
399407 if (!leftdown ) return ;
400408
401409 notebook -> priv -> drag_in_progress = TRUE;
402410
403411 /* get a new cursor, if necessary */
404412 /* FIXME multi-head */
405413 if (cursor == NULL )
406- {
407- GdkDisplay * display ;
408- display = gtk_widget_get_display (GTK_WIDGET (notebook ));
409414 cursor = gdk_cursor_new_for_display (display , GDK_FLEUR );
410- }
411415
412416 /* grab the pointer */
413417 gtk_grab_add (GTK_WIDGET (notebook ));
414418
415419 /* FIXME multi-head */
416- if (!gdk_pointer_is_grabbed ( ))
420+ if (!gdk_display_device_is_grabbed ( display , device ))
417421 {
418- gdk_pointer_grab (gtk_widget_get_window (GTK_WIDGET (notebook )),
419- FALSE,
420- GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK ,
421- NULL ,
422- cursor ,
423- time );
422+ gdk_seat_grab (seat ,
423+ gtk_widget_get_window (GTK_WIDGET (notebook )),
424+ GDK_SEAT_CAPABILITY_POINTER ,
425+ FALSE,
426+ cursor ,
427+ NULL ,
428+ NULL ,
429+ NULL );
424430 }
425431}
426432
@@ -524,8 +530,15 @@ move_current_tab_to_another_notebook (PlumaNotebook *src,
524530 GdkEventMotion * event ,
525531 gint dest_position )
526532{
527- PlumaTab * tab ;
528- gint cur_page ;
533+ PlumaTab * tab ;
534+ gint cur_page ;
535+ GdkSeat * seat ;
536+ GdkDevice * device ;
537+ GdkDisplay * display ;
538+
539+ display = gtk_widget_get_display (GTK_WIDGET (GTK_NOTEBOOK (src )));
540+ seat = gdk_display_get_default_seat (display );
541+ device = gdk_seat_get_pointer (seat );
529542
530543 /* This is getting tricky, the tab was dragged in a notebook
531544 * in another window of the same app, we move the tab
@@ -542,9 +555,9 @@ move_current_tab_to_another_notebook (PlumaNotebook *src,
542555 /* stop drag in origin window */
543556 /* ungrab the pointer if it's grabbed */
544557 drag_stop (src );
545- if (gdk_pointer_is_grabbed ( ))
558+ if (gdk_display_device_is_grabbed ( display , device ))
546559 {
547- gdk_pointer_ungrab ( event -> time );
560+ gdk_seat_ungrab ( seat );
548561 }
549562 gtk_grab_remove (GTK_WIDGET (src ));
550563
@@ -565,6 +578,14 @@ button_release_cb (PlumaNotebook *notebook,
565578 GdkEventButton * event ,
566579 gpointer data )
567580{
581+ GdkSeat * seat ;
582+ GdkDevice * device ;
583+ GdkDisplay * display ;
584+
585+ display = gtk_widget_get_display (GTK_WIDGET (GTK_NOTEBOOK (notebook )));
586+ seat = gdk_display_get_default_seat (display );
587+ device = gdk_seat_get_pointer (seat );
588+
568589 if (event -> button == 1 ) leftdown = FALSE;
569590
570591 if (notebook -> priv -> drag_in_progress )
@@ -588,9 +609,9 @@ button_release_cb (PlumaNotebook *notebook,
588609 }
589610
590611 /* ungrab the pointer if it's grabbed */
591- if (gdk_pointer_is_grabbed ( ))
612+ if (gdk_display_device_is_grabbed ( display , device ))
592613 {
593- gdk_pointer_ungrab ( event -> time );
614+ gdk_seat_ungrab ( seat );
594615 }
595616 gtk_grab_remove (GTK_WIDGET (notebook ));
596617 }
0 commit comments