@@ -357,23 +357,19 @@ static FlMethodResponse* set_always_on_top(WindowManagerPlugin* self,
357357
358358static FlMethodResponse* is_always_on_bottom (WindowManagerPlugin* self) {
359359 return FL_METHOD_RESPONSE (fl_method_success_response_new (
360- fl_value_new_bool (self->_is_always_on_bottom ))
361- );
360+ fl_value_new_bool (self->_is_always_on_bottom )));
362361}
363362
364- static FlMethodResponse* set_always_on_bottom (
365- WindowManagerPlugin* self,
366- FlValue* args) {
367- bool isAlwaysOnBottom = fl_value_get_bool (
368- fl_value_lookup_string (args, " isAlwaysOnBottom" )
369- );
363+ static FlMethodResponse* set_always_on_bottom (WindowManagerPlugin* self,
364+ FlValue* args) {
365+ bool isAlwaysOnBottom =
366+ fl_value_get_bool (fl_value_lookup_string (args, " isAlwaysOnBottom" ));
370367
371368 gtk_window_set_keep_below (get_window (self), isAlwaysOnBottom);
372369 self->_is_always_on_bottom = isAlwaysOnBottom;
373370
374- return FL_METHOD_RESPONSE (fl_method_success_response_new (
375- fl_value_new_bool (true )
376- ));
371+ return FL_METHOD_RESPONSE (
372+ fl_method_success_response_new (fl_value_new_bool (true )));
377373}
378374
379375static FlMethodResponse* get_title (WindowManagerPlugin* self) {
@@ -440,6 +436,24 @@ static FlMethodResponse* get_opacity(WindowManagerPlugin* self) {
440436 fl_method_success_response_new (fl_value_new_float (1 )));
441437}
442438
439+ static FlMethodResponse* pop_up_window_menu (WindowManagerPlugin* self) {
440+ GdkDisplay* display = gdk_display_get_default ();
441+ GdkSeat* seat = gdk_display_get_default_seat (display);
442+ GdkDevice* pointer = gdk_seat_get_pointer (seat);
443+
444+ int x, y;
445+ gdk_device_get_position (pointer, NULL , &x, &y);
446+
447+ GdkEvent* event = gdk_event_new (GDK_BUTTON_PRESS);
448+ event->key .window = get_gdk_window (self);
449+ event->button .x_root = x;
450+ event->button .y_root = y;
451+ gdk_window_show_window_menu (get_gdk_window (self), event);
452+
453+ return FL_METHOD_RESPONSE (
454+ fl_method_success_response_new (fl_value_new_float (1 )));
455+ }
456+
443457static FlMethodResponse* start_dragging (WindowManagerPlugin* self) {
444458 auto window = get_window (self);
445459 auto screen = gtk_window_get_screen (window);
@@ -613,6 +627,8 @@ static void window_manager_plugin_handle_method_call(
613627 response = set_skip_taskbar (self, args);
614628 } else if (strcmp (method, " getOpacity" ) == 0 ) {
615629 response = get_opacity (self);
630+ } else if (strcmp (method, " popUpWindowMenu" ) == 0 ) {
631+ response = pop_up_window_menu (self);
616632 } else if (strcmp (method, " startDragging" ) == 0 ) {
617633 response = start_dragging (self);
618634 } else if (strcmp (method, " startResizing" ) == 0 ) {
0 commit comments