Megan Fox and Brian Austin Green split late last year

Things were strained between Megan Fox and Brian Austin Green long before their latest — and very public — disagreement.

The estranged couple's tension came to a head over the weekend when Fox, 34, commented on Green's Instagram post with their youngest son, blasting the 47-year-old actor for being "so intoxicated with feeding the pervasive narrative that I'm an absent mother." The two share sons Noah Shannon, 8, Bodhi Ransom, 6, and Journey River, 4.

Now, a source tells PEOPLE that the two have been at odds for some time.

"They are struggling to get along and have been for a while," a source close to Fox tells PEOPLE.

A source close to Green says the actor is having a hard time with Fox's new relationship with rapper Machine Gun Kelly.

Megan Fox, Brian Austin Green
Megan Fox, Brian Austin Green
| Credit: Han Myung-Gu/WireImage; John Parra/Getty

"It's a tough situation. As a dad, Brian is great. He is wonderful with the boys," the source says. "The issue is that he is bitter that Megan moved on so quickly with Machine Gun Kelly. It's been very hard for him. His behavior can be pretty immature when it comes to Megan though. He knows how to get Megan upset. In the past, he was advised to chill out and just focus on doing the right thing for the boys."

Fox and Kelly, 30, went public with their relationship this summer after photos of them spending time together started circulating in May, prompting Green to confirm that he had separated with Fox late last year after 10 years of marriage.

(from left the right) Machine Gun Kelly, Megan Fox, Briand Austin Green

Fox's comment on Sunday also accused Green of using their kids on social media. The comment came after Green shared a photo of himself and their son Journey dressed in costumes. "Hope you all had a good Halloween!!" the father of four captioned his post on Instagram.

"Why does Journey have to be in this picture? It's not hard to crop them out. Or choose photos that they aren't in," the actress commented on the Beverly Hills, 90210 alum's post.

"I had a great halloween with them yesterday, and yet notice how absent they are from my social media. I know you love your kids. But I don't know why you can't stop using them to posture [sic] via Instagram," Fox continued.

"You're so intoxicated with feeding the pervasive narrative that I'm an absent mother, and you are the perennial, eternally dedicated dad of the year. You have them half of the time," she said. Congratulations you truly are a remarkable human! Why do you need the internet to echo back to you what should be inexhaustibly evident in the way your children love you?"

Shortly after Fox's comment, Green took down his original Halloween post. Instead, he shared the same photo but cropped out their child. "Hope you all had a happy Halloween!!!" he wrote for the revised post.