Skip to content

Commit

Permalink
Make popup window modal
Browse files Browse the repository at this point in the history
Fixes #5 and #21
  • Loading branch information
p-e-w committed Apr 23, 2017
1 parent 975c69d commit d52b395
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
4 changes: 0 additions & 4 deletions src/Module.vala
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ namespace Plotinus {
var commands = command_extractor.get_window_commands(window);

if (commands.length > 0) {
if ((window.get_window().get_state() & Gdk.WindowState.FULLSCREEN) == Gdk.WindowState.FULLSCREEN)
// The popup cannot be shown while the parent window is in fullscreen state
window.unfullscreen();

var popup_window = new PopupWindow(commands);
popup_window.transient_for = window;
popup_window.show_all();
Expand Down
10 changes: 1 addition & 9 deletions src/PopupWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class Plotinus.PopupWindow : Gtk.Window {
public PopupWindow(Command[] commands) {
skip_taskbar_hint = true;
destroy_with_parent = true;

window_position = Gtk.WindowPosition.CENTER_ON_PARENT;
set_keep_above(true);
modal = true;

// Width is determined by the width of the search entry
set_default_size(-1, 300);
Expand Down Expand Up @@ -59,12 +57,6 @@ class Plotinus.PopupWindow : Gtk.Window {
});
command_list.row_activated.connect(() => search_entry.activate());

add_events(Gdk.EventMask.FOCUS_CHANGE_MASK);
focus_out_event.connect(() => {
destroy();
return true;
});

add_events(Gdk.EventMask.KEY_PRESS_MASK);
key_press_event.connect((event) => {
if (event.keyval == Gdk.Key.Escape) {
Expand Down

0 comments on commit d52b395

Please sign in to comment.