Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
d26b3ee0
Commit
d26b3ee0
authored
3 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Implement window icon notification in SDL2 backend using native SDL2 functions
parent
641d780b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llwindow/llwindowsdl.cpp
+3
-37
3 additions, 37 deletions
indra/llwindow/llwindowsdl.cpp
indra/llwindow/llwindowsdl.h
+0
-3
0 additions, 3 deletions
indra/llwindow/llwindowsdl.h
with
3 additions
and
40 deletions
indra/llwindow/llwindowsdl.cpp
+
3
−
37
View file @
d26b3ee0
...
...
@@ -306,9 +306,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
// Stash an object pointer for OSMessageBox()
gWindowImplementation
=
this
;
#if LL_X11
mFlashing
=
FALSE
;
#endif // LL_X11
mKeyScanCode
=
0
;
mKeyVirtualKey
=
0
;
...
...
@@ -1360,38 +1358,9 @@ void LLWindowSDL::afterDialog()
}
#if LL_X11
// set/reset the XWMHints flag for 'urgency' that usually makes the icon flash
void
LLWindowSDL
::
x11_set_urgent
(
BOOL
urgent
)
{
if
(
mSDL_Display
&&
!
mFullscreen
)
{
XWMHints
*
wm_hints
;
LL_INFOS
()
<<
"X11 hint for urgency, "
<<
urgent
<<
LL_ENDL
;
wm_hints
=
XGetWMHints
(
mSDL_Display
,
mSDL_XWindowID
);
if
(
!
wm_hints
)
wm_hints
=
XAllocWMHints
();
if
(
urgent
)
wm_hints
->
flags
|=
XUrgencyHint
;
else
wm_hints
->
flags
&=
~
XUrgencyHint
;
XSetWMHints
(
mSDL_Display
,
mSDL_XWindowID
,
wm_hints
);
XFree
(
wm_hints
);
XSync
(
mSDL_Display
,
False
);
}
}
#endif // LL_X11
void
LLWindowSDL
::
flashIcon
(
F32
seconds
)
{
#if !LL_X11
LL_INFOS
()
<<
"Stub LLWindowSDL::flashIcon("
<<
seconds
<<
")"
<<
LL_ENDL
;
#else
LL_INFOS
()
<<
"X11 LLWindowSDL::flashIcon("
<<
seconds
<<
")"
<<
LL_ENDL
;
LL_INFOS
()
<<
"LLWindowSDL::flashIcon("
<<
seconds
<<
")"
<<
LL_ENDL
;
F32
remaining_time
=
mFlashTimer
.
getRemainingTimeF32
();
if
(
remaining_time
<
seconds
)
...
...
@@ -1399,9 +1368,8 @@ void LLWindowSDL::flashIcon(F32 seconds)
mFlashTimer
.
reset
();
mFlashTimer
.
setTimerExpirySec
(
remaining_time
);
x11_set_urgent
(
TRUE
);
SDL_FlashWindow
(
mWindow
,
SDL_FLASH_UNTIL_FOCUSED
);
mFlashing
=
TRUE
;
#endif // LL_X11
}
...
...
@@ -2066,15 +2034,13 @@ void LLWindowSDL::gatherInput()
updateCursor
();
#if LL_X11
// This is a good time to stop flashing the icon if our mFlashTimer has
// expired.
if
(
mFlashing
&&
mFlashTimer
.
hasExpired
())
{
x11_set_urgent
(
FALSE
);
SDL_FlashWindow
(
mWindow
,
SDL_FLASH_CANCEL
);
mFlashing
=
FALSE
;
}
#endif // LL_X11
}
static
SDL_Cursor
*
makeSDLCursorFromBMP
(
const
char
*
filename
,
int
hotx
,
int
hoty
)
...
...
This diff is collapsed.
Click to expand it.
indra/llwindow/llwindowsdl.h
+
0
−
3
View file @
d26b3ee0
...
...
@@ -207,11 +207,8 @@ class LLWindowSDL final : public LLWindow
friend
class
LLWindowManager
;
private
:
#if LL_X11
void
x11_set_urgent
(
BOOL
urgent
);
BOOL
mFlashing
;
LLTimer
mFlashTimer
;
#endif //LL_X11
U32
mKeyScanCode
;
U32
mKeyVirtualKey
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment