Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
9fa5378b
Commit
9fa5378b
authored
Jan 16, 2010
by
Geoffroy Couprie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: fix Win7's taskbar buttons
parent
427d73cd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
61 deletions
+58
-61
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+49
-25
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+7
-0
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+2
-4
modules/gui/qt4/util/qvlcapp.hpp
modules/gui/qt4/util/qvlcapp.hpp
+0
-32
No files found.
modules/gui/qt4/main_interface.cpp
View file @
9fa5378b
...
...
@@ -168,7 +168,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
MainInputManager
::
getInstance
(
p_intf
);
#ifdef WIN32
createTaskBarButtons
(
);
taskbar_wmsg
=
RegisterWindowMessage
(
"TaskbarButtonCreated"
);
#endif
/************************************************************
...
...
@@ -510,6 +510,7 @@ inline void MainInterface::createStatusBar()
#ifdef WIN32
void
MainInterface
::
createTaskBarButtons
()
{
taskbar_wmsg
=
WM_NULL
;
/*Here is the code for the taskbar thumb buttons
FIXME:We need pretty buttons in 16x16 px that are handled correctly by masks in Qt
FIXME:the play button's picture doesn't changed to pause when clicked
...
...
@@ -553,9 +554,6 @@ void MainInterface::createTaskBarButtons()
{
p_taskbl
->
vt
->
HrInit
(
p_taskbl
);
int
msg_value
=
RegisterWindowMessage
(
"TaskbarButtonCreated"
);
//msg_Info( p_intf, "msg value: %04x", msg_value );
// Define an array of two buttons. These buttons provide images through an
// image list and also provide tooltips.
DWORD
dwMask
=
THB_BITMAP
|
THB_FLAGS
;
...
...
@@ -576,13 +574,19 @@ void MainInterface::createTaskBarButtons()
thbButtons
[
2
].
iBitmap
=
3
;
thbButtons
[
2
].
dwFlags
=
THBF_HIDDEN
;
HRESULT
hr
=
p_taskbl
->
vt
->
ThumbBarSetImageList
(
p_taskbl
,
GetForegroundWindow
(),
himl
);
HRESULT
hr
=
p_taskbl
->
vt
->
ThumbBarSetImageList
(
p_taskbl
,
winId
(),
himl
);
if
(
S_OK
!=
hr
)
msg_Err
(
p_intf
,
"ThumbBarSetImageList failed with error %08x"
,
hr
);
if
(
S_OK
!=
p_taskbl
->
vt
->
ThumbBarAddButtons
(
p_taskbl
,
GetForegroundWindow
(),
3
,
thbButtons
))
msg_Err
(
p_intf
,
"ThumbBarAddButtons failed with error %08x"
,
GetLastError
()
);
else
{
hr
=
p_taskbl
->
vt
->
ThumbBarAddButtons
(
p_taskbl
,
winId
(),
3
,
thbButtons
);
if
(
S_OK
!=
hr
)
msg_Err
(
p_intf
,
"ThumbBarAddButtons failed with error %08x"
,
hr
);
}
CONNECT
(
THEMIM
->
getIM
(),
statusChanged
(
int
),
this
,
changeThumbbarButtons
(
int
)
);
CONNECT
(
this
,
playPauseSignal
(),
THEMIM
,
togglePlayPause
()
);
CONNECT
(
this
,
prevSignal
(),
THEMIM
,
prev
()
);
CONNECT
(
this
,
nextSignal
(),
THEMIM
,
next
()
);
}
}
else
...
...
@@ -591,10 +595,37 @@ void MainInterface::createTaskBarButtons()
p_taskbl
=
NULL
;
}
}
#endif
bool
MainInterface
::
winEvent
(
MSG
*
msg
,
long
*
result
)
{
if
(
msg
->
message
==
taskbar_wmsg
)
{
//We received the taskbarbuttoncreated, now we can really create th buttons
createTaskBarButtons
();
}
switch
(
msg
->
message
)
{
case
WM_COMMAND
:
if
(
HIWORD
(
msg
->
wParam
)
==
THBN_CLICKED
)
{
switch
(
LOWORD
(
msg
->
wParam
))
{
case
0
:
emit
prevSignal
();
break
;
case
1
:
emit
playPauseSignal
();
break
;
case
2
:
emit
nextSignal
();
break
;
}
}
break
;
}
return
false
;
}
#endif
/**********************************************************************
* Handling of sizing of the components
...
...
@@ -1420,7 +1451,7 @@ void MainInterface::toggleFullScreen( void )
void
MainInterface
::
changeThumbbarButtons
(
int
i_status
)
{
#ifdef WIN32
// Define an array of t
wo
buttons. These buttons provide images through an
// Define an array of t
hree
buttons. These buttons provide images through an
// image list and also provide tooltips.
DWORD
dwMask
=
THB_BITMAP
|
THB_FLAGS
;
...
...
@@ -1441,14 +1472,6 @@ void MainInterface::changeThumbbarButtons( int i_status)
switch
(
i_status
)
{
case
0
:
case
END_S
:
{
thbButtons
[
0
].
dwFlags
=
THBF_HIDDEN
;
thbButtons
[
1
].
dwFlags
=
THBF_HIDDEN
;
thbButtons
[
2
].
dwFlags
=
THBF_HIDDEN
;
break
;
}
case
PLAYING_S
:
{
thbButtons
[
0
].
dwFlags
=
THBF_ENABLED
;
...
...
@@ -1459,15 +1482,16 @@ void MainInterface::changeThumbbarButtons( int i_status)
}
case
PAUSE_S
:
{
//
thbButtons[0].dwFlags = THBF_ENABLED;
//
thbButtons[1].dwFlags = THBF_ENABLED;
//
thbButtons[2].dwFlags = THBF_ENABLED;
thbButtons
[
0
].
dwFlags
=
THBF_ENABLED
;
thbButtons
[
1
].
dwFlags
=
THBF_ENABLED
;
thbButtons
[
2
].
dwFlags
=
THBF_ENABLED
;
thbButtons
[
1
].
iBitmap
=
2
;
break
;
}
default:
return
;
}
HRESULT
hr
=
p_taskbl
->
vt
->
ThumbBarUpdateButtons
(
p_taskbl
,
GetForegroundWindow
(),
3
,
thbButtons
);
HRESULT
hr
=
p_taskbl
->
vt
->
ThumbBarUpdateButtons
(
p_taskbl
,
this
->
winId
(),
3
,
thbButtons
);
if
(
S_OK
!=
hr
)
msg_Err
(
p_intf
,
"ThumbBarUpdateButtons failed with error %08x"
,
hr
);
#else
...
...
modules/gui/qt4/main_interface.hpp
View file @
9fa5378b
...
...
@@ -97,6 +97,9 @@ public:
protected:
void
dropEventPlay
(
QDropEvent
*
,
bool
);
#ifdef WIN32
bool
winEvent
(
MSG
*
,
long
*
);
#endif
virtual
void
dropEvent
(
QDropEvent
*
);
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
);
...
...
@@ -171,6 +174,7 @@ private:
#ifdef WIN32
HIMAGELIST
himl
;
LPTASKBARLIST3
p_taskbl
;
UINT
taskbar_wmsg
;
void
createTaskBarButtons
();
#endif
void
createPlaylist
(
bool
);
...
...
@@ -222,6 +226,9 @@ signals:
void
askUpdate
();
void
minimalViewToggled
(
bool
);
void
fullscreenInterfaceToggled
(
bool
);
void
playPauseSignal
();
void
prevSignal
();
void
nextSignal
();
};
#endif
modules/gui/qt4/qt4.cpp
View file @
9fa5378b
...
...
@@ -364,11 +364,9 @@ static void *Thread( void *obj )
argv
[
argc
]
=
NULL
;
}
#endif
#ifdef WIN32
QVLCApp
app
(
p_intf
,
argc
,
argv
);
#else
QVLCApp
app
(
argc
,
argv
);
#endif
p_intf
->
p_sys
->
p_app
=
&
app
;
...
...
modules/gui/qt4/util/qvlcapp.hpp
View file @
9fa5378b
...
...
@@ -41,20 +41,10 @@ class QVLCApp : public QApplication
Q_OBJECT
public:
#ifdef WIN32
QVLCApp
(
intf_thread_t
*
p_intf
,
int
&
argc
,
char
**
argv
)
:
QApplication
(
argc
,
argv
,
true
)
{
connect
(
this
,
SIGNAL
(
quitSignal
()),
this
,
SLOT
(
quit
())
);
CONNECT
(
this
,
playPauseSignal
(),
THEMIM
,
togglePlayPause
()
);
CONNECT
(
this
,
prevSignal
(),
THEMIM
,
prev
()
);
CONNECT
(
this
,
nextSignal
(),
THEMIM
,
next
()
);
}
#else
QVLCApp
(
int
&
argc
,
char
**
argv
)
:
QApplication
(
argc
,
argv
,
true
)
{
connect
(
this
,
SIGNAL
(
quitSignal
()),
this
,
SLOT
(
quit
())
);
}
#endif
static
void
triggerQuit
()
{
...
...
@@ -82,25 +72,6 @@ protected:
DefWindowProc
(
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
break
;
case
0xC0C2
:
/* TaskbarButtonCreated */
break
;
case
WM_COMMAND
:
if
(
HIWORD
(
msg
->
wParam
)
==
THBN_CLICKED
)
{
switch
(
LOWORD
(
msg
->
wParam
))
{
case
0
:
emit
prevSignal
();
break
;
case
1
:
emit
playPauseSignal
();
break
;
case
2
:
emit
nextSignal
();
break
;
}
}
break
;
}
return
false
;
}
...
...
@@ -109,9 +80,6 @@ protected:
signals:
void
quitSignal
();
void
playPauseSignal
();
void
prevSignal
();
void
nextSignal
();
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment