Skip to content

Add PopupDialog widget - draggable, re-focusable dialog.#13658

Open
mtwebster wants to merge 5 commits intolinuxmint:masterfrom
mtwebster:draggable-dialog
Open

Add PopupDialog widget - draggable, re-focusable dialog.#13658
mtwebster wants to merge 5 commits intolinuxmint:masterfrom
mtwebster:draggable-dialog

Conversation

@mtwebster
Copy link
Member

  • baseDialog.js: adds a base class for shared code between modal
    and popup dialog.
  • popupDialog.js: Draggable wrapper for Dialog.Dialog, to use in
    place of ModalDialog.
  • The 'popup-dialog' css class can be used to help differeniation.
    In the default theme, there's a faint box shadow that uses the
    accent color.

ref:
https://github.com/orgs/linuxmint/discussions/774

- baseDialog.js: adds a base class for shared code between modal
  and popup dialog.
- popupDialog.js: Draggable wrapper for Dialog.Dialog, to use in
  place of ModalDialog.
- The 'popup-dialog' css class can be used to help differeniation.
  In the default theme, there's a faint box shadow that uses the
  accent color.

ref:
https://github.com/orgs/linuxmint/discussions/774
This is nice to have now with dialogs not being permanently-focused.
A popup dialog may be visible, and may have been added after the
modal (the RunDialog doesn't get destroyed once instantiated).
@github-actions
Copy link

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ global_begin_modal

js/ui/popupDialog.js:168

this._dragGrabbed = global.begin_modal(global.get_current_time(), 0);

global.begin_modal() grabs all keyboard and mouse input exclusively.
Improper use will freeze the desktop. This should never be used in third-party code.

⚠️ global_set_stage_input_mode

js/ui/popupDialog.js:82

global.set_stage_input_mode(Cinnamon.StageInputMode.NORMAL);

global.set_stage_input_mode() controls how all input events are routed.
Misuse can make the desktop unresponsive. This should never be used in third-party code.

js/ui/popupDialog.js:103

global.set_stage_input_mode(Cinnamon.StageInputMode.FOCUSED);

global.set_stage_input_mode() controls how all input events are routed.
Misuse can make the desktop unresponsive. This should never be used in third-party code.


Automated pattern check.

@github-actions
Copy link

Best-practices scanner

This is a regex-based check for API usage that can pose security, performance or
maintainability issues, or that may already be provided by Cinnamon. Having code flagged
by it doesn't automatically disqualify a pull request.

This check is not perfect will not replace a normal review.


Found 3 potential issue(s):

⚠️ global_begin_modal

js/ui/popupDialog.js:200

this._dragGrabbed = global.begin_modal(global.get_current_time(), 0);

global.begin_modal() grabs all keyboard and mouse input exclusively.
Improper use will freeze the desktop. This should never be used in third-party code.

⚠️ global_set_stage_input_mode

js/ui/popupDialog.js:98

global.set_stage_input_mode(Cinnamon.StageInputMode.NORMAL);

global.set_stage_input_mode() controls how all input events are routed.
Misuse can make the desktop unresponsive. This should never be used in third-party code.

js/ui/popupDialog.js:119

global.set_stage_input_mode(Cinnamon.StageInputMode.FOCUSED);

global.set_stage_input_mode() controls how all input events are routed.
Misuse can make the desktop unresponsive. This should never be used in third-party code.


Automated pattern check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant