summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-09-25 01:44:09 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-09-25 01:44:09 -0400
commit3027e00905b19282a4f501a26f7a4f71bc6940ea (patch)
treea4a3f92bf65887771cb9a19905fea468d359453d /src/components
parent2ecbacc9243080c89c415a68b65eef34a1054a53 (diff)
downloadabaddon-portaudio-3027e00905b19282a4f501a26f7a4f71bc6940ea.tar.gz
abaddon-portaudio-3027e00905b19282a4f501a26f7a4f71bc6940ea.zip
open browser on mouse release (fixes #108)
Diffstat (limited to 'src/components')
-rw-r--r--src/components/chatmessage.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/chatmessage.cpp b/src/components/chatmessage.cpp
index 89c924e..3afdf9f 100644
--- a/src/components/chatmessage.cpp
+++ b/src/components/chatmessage.cpp
@@ -150,8 +150,8 @@ void ChatMessageItemContainer::UpdateAttributes() {
void ChatMessageItemContainer::AddClickHandler(Gtk::Widget *widget, const std::string &url) {
// clang-format off
- widget->signal_button_press_event().connect([url](GdkEventButton *event) -> bool {
- if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_PRIMARY) {
+ widget->signal_button_release_event().connect([url](GdkEventButton *event) -> bool {
+ if (event->type == GDK_BUTTON_RELEASE && event->button == GDK_BUTTON_PRIMARY) {
LaunchBrowser(url);
return true;
}
@@ -357,8 +357,8 @@ Gtk::Widget *ChatMessageItemContainer::CreateEmbedComponent(const EmbedData &emb
if (embed.URL.has_value()) {
AddPointerCursor(*title_ev);
auto url = *embed.URL;
- title_ev->signal_button_press_event().connect([url = std::move(url)](GdkEventButton *event) -> bool {
- if (event->button == GDK_BUTTON_PRIMARY) {
+ title_ev->signal_button_release_event().connect([url = std::move(url)](GdkEventButton *event) -> bool {
+ if (event->type == GDK_BUTTON_RELEASE && event->button == GDK_BUTTON_PRIMARY) {
LaunchBrowser(url);
return true;
}